@coorpacademy/components 11.9.0 → 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 (74) hide show
  1. package/es/atom/loader/index.native.d.ts.map +1 -1
  2. package/es/atom/loader/index.native.js +11 -9
  3. package/es/atom/loader/index.native.js.map +1 -1
  4. package/es/atom/review-presentation/index.d.ts.map +1 -1
  5. package/es/atom/review-presentation/index.js +12 -62
  6. package/es/atom/review-presentation/index.js.map +1 -1
  7. package/es/atom/review-presentation/index.native.d.ts.map +1 -1
  8. package/es/atom/review-presentation/index.native.js +7 -2
  9. package/es/atom/review-presentation/index.native.js.map +1 -1
  10. package/es/atom/review-presentation/style.css +7 -67
  11. package/es/atom/tooltip/index.d.ts +22 -0
  12. package/es/atom/tooltip/index.d.ts.map +1 -0
  13. package/es/atom/tooltip/index.js +117 -0
  14. package/es/atom/tooltip/index.js.map +1 -0
  15. package/es/atom/tooltip/style.css +96 -0
  16. package/es/template/activity/engine-stars.css +16 -33
  17. package/es/template/activity/engine-stars.d.ts +15 -17
  18. package/es/template/activity/engine-stars.d.ts.map +1 -1
  19. package/es/template/activity/engine-stars.js +128 -115
  20. package/es/template/activity/engine-stars.js.map +1 -1
  21. package/es/template/activity/index.d.ts +1 -0
  22. package/es/template/activity/index.d.ts.map +1 -1
  23. package/es/template/activity/index.js +18 -9
  24. package/es/template/activity/index.js.map +1 -1
  25. package/es/template/activity/progression-item.js +1 -1
  26. package/es/template/activity/progression-item.js.map +1 -1
  27. package/es/template/activity/stars-summary.d.ts +1 -0
  28. package/es/template/activity/stars-summary.d.ts.map +1 -1
  29. package/es/template/activity/stars-summary.js +10 -5
  30. package/es/template/activity/stars-summary.js.map +1 -1
  31. package/es/template/app-review/index.native.d.ts.map +1 -1
  32. package/es/template/app-review/index.native.js +48 -20
  33. package/es/template/app-review/index.native.js.map +1 -1
  34. package/es/template/app-review/skills/index.native.d.ts.map +1 -1
  35. package/es/template/app-review/skills/index.native.js +26 -5
  36. package/es/template/app-review/skills/index.native.js.map +1 -1
  37. package/lib/atom/loader/index.native.d.ts.map +1 -1
  38. package/lib/atom/loader/index.native.js +11 -9
  39. package/lib/atom/loader/index.native.js.map +1 -1
  40. package/lib/atom/review-presentation/index.d.ts.map +1 -1
  41. package/lib/atom/review-presentation/index.js +13 -66
  42. package/lib/atom/review-presentation/index.js.map +1 -1
  43. package/lib/atom/review-presentation/index.native.d.ts.map +1 -1
  44. package/lib/atom/review-presentation/index.native.js +7 -2
  45. package/lib/atom/review-presentation/index.native.js.map +1 -1
  46. package/lib/atom/review-presentation/style.css +7 -67
  47. package/lib/atom/tooltip/index.d.ts +22 -0
  48. package/lib/atom/tooltip/index.d.ts.map +1 -0
  49. package/lib/atom/tooltip/index.js +137 -0
  50. package/lib/atom/tooltip/index.js.map +1 -0
  51. package/lib/atom/tooltip/style.css +96 -0
  52. package/lib/template/activity/engine-stars.css +16 -33
  53. package/lib/template/activity/engine-stars.d.ts +15 -17
  54. package/lib/template/activity/engine-stars.d.ts.map +1 -1
  55. package/lib/template/activity/engine-stars.js +135 -116
  56. package/lib/template/activity/engine-stars.js.map +1 -1
  57. package/lib/template/activity/index.d.ts +1 -0
  58. package/lib/template/activity/index.d.ts.map +1 -1
  59. package/lib/template/activity/index.js +21 -9
  60. package/lib/template/activity/index.js.map +1 -1
  61. package/lib/template/activity/progression-item.js +1 -1
  62. package/lib/template/activity/progression-item.js.map +1 -1
  63. package/lib/template/activity/stars-summary.d.ts +1 -0
  64. package/lib/template/activity/stars-summary.d.ts.map +1 -1
  65. package/lib/template/activity/stars-summary.js +10 -5
  66. package/lib/template/activity/stars-summary.js.map +1 -1
  67. package/lib/template/app-review/index.native.d.ts.map +1 -1
  68. package/lib/template/app-review/index.native.js +49 -19
  69. package/lib/template/app-review/index.native.js.map +1 -1
  70. package/lib/template/app-review/skills/index.native.d.ts.map +1 -1
  71. package/lib/template/app-review/skills/index.native.js +30 -7
  72. package/lib/template/app-review/skills/index.native.js.map +1 -1
  73. package/locales/en/global.json +1 -0
  74. package/package.json +5 -4
@@ -3,7 +3,7 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- var _react = _interopRequireWildcard(require("react"));
6
+ var _react = _interopRequireDefault(require("react"));
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
@@ -13,18 +13,14 @@ var _map = _interopRequireDefault(require("lodash/fp/map"));
13
13
 
14
14
  var _novaIcons = require("@coorpacademy/nova-icons");
15
15
 
16
+ var _tooltip = _interopRequireDefault(require("../tooltip"));
17
+
16
18
  var _style = _interopRequireDefault(require("./style.css"));
17
19
 
18
20
  var _propTypes2 = _interopRequireDefault(require("./prop-types"));
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
27
-
28
24
  const ICONS = {
29
25
  skills: _novaIcons.NovaLineSelectionCursorsCursorArrowTarget,
30
26
  questions: _novaIcons.NovaSolidInterfaceFeedbackInterfaceQuestionMark,
@@ -49,50 +45,6 @@ const ReviewIcon = ({
49
45
  });
50
46
  };
51
47
 
52
- const ToolTip = ({
53
- tooltipText,
54
- 'aria-label': moreDetailsAriaLabel,
55
- 'data-testid': dataTestId,
56
- closeToolTipInformationTextAriaLabel
57
- }) => {
58
- const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
59
- const handleKeyPress = (0, _react.useCallback)(event => {
60
- if (event.key === 'Enter') {
61
- setToolTipIsVisible(!toolTipIsVisible);
62
- } else if (event.key === 'Tab' || event.key === 'Escape') {
63
- setToolTipIsVisible(false);
64
- }
65
- }, [setToolTipIsVisible, toolTipIsVisible]);
66
- const handleMouseOver = (0, _react.useCallback)(() => {
67
- setToolTipIsVisible(true);
68
- }, [setToolTipIsVisible]);
69
- const handleMouseLeave = (0, _react.useCallback)(() => {
70
- setToolTipIsVisible(false);
71
- }, [setToolTipIsVisible]);
72
- return /*#__PURE__*/_react.default.createElement("div", {
73
- className: _style.default.tooltipContainer,
74
- onMouseLeave: handleMouseLeave,
75
- onMouseOver: handleMouseOver
76
- }, /*#__PURE__*/_react.default.createElement("button", {
77
- type: "button",
78
- className: _style.default.tooltipIconContainer,
79
- "data-testid": dataTestId,
80
- onKeyDown: handleKeyPress,
81
- tabIndex: 0
82
- }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
83
- className: _style.default.informationIcon,
84
- width: 12,
85
- height: 12,
86
- "aria-label": moreDetailsAriaLabel
87
- })), toolTipIsVisible ? /*#__PURE__*/_react.default.createElement("div", {
88
- className: _style.default.toolTip,
89
- "data-testid": "review-presentation-tooltip",
90
- "aria-label": closeToolTipInformationTextAriaLabel
91
- }, /*#__PURE__*/_react.default.createElement("p", {
92
- className: _style.default.tooltipText
93
- }, tooltipText)) : null);
94
- };
95
-
96
48
  const ReviewListItemWrapper = ({
97
49
  iconKey,
98
50
  label
@@ -106,11 +58,11 @@ const ReviewListItemWrapper = ({
106
58
  className: _style.default.reviewListText
107
59
  }, /*#__PURE__*/_react.default.createElement(ReviewIcon, {
108
60
  icon: iconKey
109
- }), " ", label.text), /*#__PURE__*/_react.default.createElement(ToolTip, {
110
- tooltipText: label.tooltipText,
111
- "aria-label": label.moreDetailsAriaLabel,
61
+ }), " ", label.text), /*#__PURE__*/_react.default.createElement(_tooltip.default, {
62
+ TooltipContent: label.tooltipText,
112
63
  closeToolTipInformationTextAriaLabel: label.closeToolTipInformationTextAriaLabel,
113
- "data-testid": `review-list-item-tooltip-button-${iconKey}`
64
+ "data-testid": `review-list-item-tooltip-button-${iconKey}`,
65
+ "aria-label": label.moreDetailsAriaLabel
114
66
  }));
115
67
  };
116
68
 
@@ -153,23 +105,18 @@ const ReviewPresentation = props => {
153
105
  }, labelsList)));
154
106
  };
155
107
 
156
- ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
157
- tooltipText: _propTypes.default.string,
158
- 'aria-label': _propTypes.default.string,
159
- 'data-testid': _propTypes.default.string,
160
- closeToolTipInformationTextAriaLabel: _propTypes.default.string
161
- } : {};
162
108
  ReviewIcon.propTypes = process.env.NODE_ENV !== "production" ? {
163
109
  icon: _propTypes.default.string
164
110
  } : {};
165
- ReviewListItemWrapper.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, ToolTip.propTypes, {
111
+ ReviewListItemWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
166
112
  iconKey: _propTypes.default.string,
167
113
  label: _propTypes.default.shape({
168
- tooltipText: _propTypes.default.string,
169
- moreDetailsAriaLabel: _propTypes.default.string,
170
- closeToolTipInformationTextAriaLabel: _propTypes.default.string
114
+ tooltipText: _tooltip.default.propTypes.tooltipText,
115
+ moreDetailsAriaLabel: _tooltip.default.propTypes['aria-label'],
116
+ closeToolTipInformationTextAriaLabel: _tooltip.default.propTypes.closeToolTipInformationTextAriaLabel,
117
+ text: _propTypes.default.string
171
118
  })
172
- }) : {};
119
+ } : {};
173
120
  ReviewPresentation.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.default : {};
174
121
  var _default = ReviewPresentation;
175
122
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ICONS","skills","TargetIcon","questions","QuestionIcon","lifes","HeartIcon","allright","CheckIcon","ReviewIcon","icon","Icon","getOr","style","labelIcon","ToolTip","tooltipText","moreDetailsAriaLabel","dataTestId","closeToolTipInformationTextAriaLabel","toolTipIsVisible","setToolTipIsVisible","useState","handleKeyPress","useCallback","event","key","handleMouseOver","handleMouseLeave","tooltipContainer","tooltipIconContainer","informationIcon","toolTip","ReviewListItemWrapper","iconKey","label","reviewListItemWrapper","reviewListText","text","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","map","convert","cap","reviewList","propTypes","PropTypes","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;;AACA;;AACA;;AACA;;AACA;;AAOA;;AACA;;;;;;;;;;AAEA,MAAMA,KAAK,GAAG;EACZC,MAAM,EAAEC,oDADI;EAEZC,SAAS,EAAEC,0DAFC;EAGZC,KAAK,EAAEC,wCAHK;EAIZC,QAAQ,EAAEC;AAJE,CAAd;;AAOA,MAAMC,UAAU,GAAG,CAAC;EAACC;AAAD,CAAD,KAAY;EAC7B,MAAMC,IAAI,GAAG,IAAAC,cAAA,EAAM,IAAN,EAAYF,IAAZ,EAAkBV,KAAlB,CAAb;EAEA;;EACA,IAAI,CAACW,IAAL,EAAW;IACT,oBAAO;MAAK,SAAS,EAAEE,cAAA,CAAMC;IAAtB,EAAP;EACD;;EACD,oBAAO,6BAAC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MkC;EAArB,GACGC,YAAA,CAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACf,KAAD,EAAQT,GAAR,KAAgB;IACzC,oBACE;MAAI,GAAG,EAAG,QAAOA,GAAI,EAArB;MAAwB,SAAS,EAAEb,cAAA,CAAMsC;IAAzC,gBACE,6BAAC,qBAAD;MACE,OAAO,EAAEzB,GADX;MAEE,KAAK,EAAES,KAFT;MAGE,WAAW,EAAEA,KAAK,CAACnB,WAHrB;MAIE,cAAYmB,KAAK,CAAClB;IAJpB,EADF,CADF;EAUD,CAXA,EAWE2B,UAXF,CADH,CAXF,CADF;AA4BD,CA/BD;;AAiCA7B,OAAO,CAACqC,SAAR,2CAAoB;EAClBpC,WAAW,EAAEqC,kBAAA,CAAUC,MADL;EAElB,cAAcD,kBAAA,CAAUC,MAFN;EAGlB,eAAeD,kBAAA,CAAUC,MAHP;EAIlBnC,oCAAoC,EAAEkC,kBAAA,CAAUC;AAJ9B,CAApB;AAOA7C,UAAU,CAAC2C,SAAX,2CAAuB;EACrB1C,IAAI,EAAE2C,kBAAA,CAAUC;AADK,CAAvB;AAIArB,qBAAqB,CAACmB,SAAtB,wDACKrC,OAAO,CAACqC,SADb;EAEElB,OAAO,EAAEmB,kBAAA,CAAUC,MAFrB;EAGEnB,KAAK,EAAEkB,kBAAA,CAAUE,KAAV,CAAgB;IACrBvC,WAAW,EAAEqC,kBAAA,CAAUC,MADF;IAErBrC,oBAAoB,EAAEoC,kBAAA,CAAUC,MAFX;IAGrBnC,oCAAoC,EAAEkC,kBAAA,CAAUC;EAH3B,CAAhB;AAHT;AAUAf,kBAAkB,CAACa,SAAnB,2CAA+BA,mBAA/B;eAEeb,kB"}
1
+ {"version":3,"file":"index.js","names":["ICONS","skills","TargetIcon","questions","QuestionIcon","lifes","HeartIcon","allright","CheckIcon","ReviewIcon","icon","Icon","getOr","style","labelIcon","ReviewListItemWrapper","iconKey","label","reviewListItemWrapper","reviewListText","text","tooltipText","closeToolTipInformationTextAriaLabel","moreDetailsAriaLabel","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","map","convert","cap","key","reviewList","propTypes","PropTypes","string","shape","ToolTip"],"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;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;;;AAEA,MAAMA,KAAK,GAAG;EACZC,MAAM,EAAEC,oDADI;EAEZC,SAAS,EAAEC,0DAFC;EAGZC,KAAK,EAAEC,wCAHK;EAIZC,QAAQ,EAAEC;AAJE,CAAd;;AAOA,MAAMC,UAAU,GAAG,CAAC;EAACC;AAAD,CAAD,KAAY;EAC7B,MAAMC,IAAI,GAAG,IAAAC,cAAA,EAAM,IAAN,EAAYF,IAAZ,EAAkBV,KAAlB,CAAb;EAEA;;EACA,IAAI,CAACW,IAAL,EAAW;IACT,oBAAO;MAAK,SAAS,EAAEE,cAAA,CAAMC;IAAtB,EAAP;EACD;;EACD,oBAAO,6BAAC,IAAD;IAAM,SAAS,EAAED,cAAA,CAAMC;EAAvB,EAAP;AACD,CARD;;AAUA,MAAMC,qBAAqB,GAAG,CAAC;EAACC,OAAD;EAAUC;AAAV,CAAD,KAAsB;EAClD,oBACE;IAAK,SAAS,EAAEJ,cAAA,CAAMK,qBAAtB;IAA6C,gBAA7C;IAAsD,YAAS,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A4BD,CA/BD;;AAiCApB,UAAU,CAAC6B,SAAX,2CAAuB;EACrB5B,IAAI,EAAE6B,kBAAA,CAAUC;AADK,CAAvB;AAIAzB,qBAAqB,CAACuB,SAAtB,2CAAkC;EAChCtB,OAAO,EAAEuB,kBAAA,CAAUC,MADa;EAEhCvB,KAAK,EAAEsB,kBAAA,CAAUE,KAAV,CAAgB;IACrBpB,WAAW,EAAEqB,gBAAA,CAAQJ,SAAR,CAAkBjB,WADV;IAErBE,oBAAoB,EAAEmB,gBAAA,CAAQJ,SAAR,CAAkB,YAAlB,CAFD;IAGrBhB,oCAAoC,EAAEoB,gBAAA,CAAQJ,SAAR,CAAkBhB,oCAHnC;IAIrBF,IAAI,EAAEmB,kBAAA,CAAUC;EAJK,CAAhB;AAFyB,CAAlC;AAUAhB,kBAAkB,CAACc,SAAnB,2CAA+BA,mBAA/B;eAEed,kB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.native.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAC,eAAe,EAAW,MAAM,cAAc,CAAC;AAoGvD,QAAA,MAAM,UAAU,UAAW,eAAe,uBA4CzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.native.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAC,eAAe,EAAW,MAAM,cAAc,CAAC;AAwGvD,QAAA,MAAM,UAAU,UAAW,eAAe,uBA+CzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -39,6 +39,9 @@ const createStyleSheet = (brandTheme, theme) => _reactNative.StyleSheet.create({
39
39
  color: theme.colors.text.primary,
40
40
  marginBottom: 32
41
41
  },
42
+ textContainer: {
43
+ marginTop: 8
44
+ },
42
45
  text: {
43
46
  fontSize: theme.fontSize.large,
44
47
  color: theme.colors.text.primary,
@@ -141,9 +144,11 @@ const Onboarding = props => {
141
144
  style: styleSheet.container
142
145
  }, /*#__PURE__*/_react.default.createElement(_index2.default, {
143
146
  style: styleSheet.title
144
- }, translations.appReview.presentation.title), /*#__PURE__*/_react.default.createElement(_index2.default, {
147
+ }, translations.appReview.presentation.title), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
148
+ style: styleSheet.textContainer
149
+ }, /*#__PURE__*/_react.default.createElement(_index2.default, {
145
150
  style: styleSheet.text
146
- }, translations.appReview.presentation.text), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
151
+ }, translations.appReview.presentation.text)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
147
152
  style: styleSheet.tips
148
153
  }, /*#__PURE__*/_react.default.createElement(Tip, {
149
154
  Icon: _novaIcons.NovaLineSelectionCursorsCursorArrowTarget,
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","justifyContent","flex","padding","paddingTop","paddingBottom","title","height","width","fontSize","xxlarge","fontWeight","bold","lineHeight","color","text","primary","marginBottom","large","opacity","tips","marginTop","tip","flexDirection","overflow","alignItems","borderRadius","gray","extra","spacing","micro","tipText","icon","margin","button","cta","buttonText","alignSelf","Tip","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","Icon","useEffect","_stylesheet","Onboarding","translations","onPress","appReview","presentation","TargetIcon","labelList","skills","QuestionMarkIcon","questions","HeartIcon","lifes","CheckCircle2Icon","allright","ok"],"sources":["../../../src/atom/review-presentation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionMarkIcon,\n NovaSolidStatusCheckCircle2 as CheckCircle2Icon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport Html from '../html/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {OnboardingProps, TipProps} from './prop-types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n title: TextStyle;\n text: TextStyle;\n tips: ViewStyle;\n tip: ViewStyle;\n tipText: TextStyle;\n icon: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n justifyContent: 'space-between',\n flex: 1,\n padding: 20,\n paddingTop: 20,\n paddingBottom: 100\n },\n title: {\n height: 72,\n width: 268,\n fontSize: theme.fontSize.xxlarge,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 36,\n color: theme.colors.text.primary,\n marginBottom: 32\n },\n text: {\n fontSize: theme.fontSize.large,\n color: theme.colors.text.primary,\n opacity: 0.7\n },\n tips: {\n marginTop: 32,\n height: 230,\n justifyContent: 'center'\n },\n tip: {\n flexDirection: 'row',\n overflow: 'hidden',\n alignItems: 'center',\n height: 54,\n borderRadius: 8,\n backgroundColor: theme.colors.gray.extra,\n marginTop: theme.spacing.micro,\n marginBottom: theme.spacing.micro\n },\n tipText: {\n fontSize: 16,\n lineHeight: 22,\n color: theme.colors.text.primary\n },\n icon: {\n margin: 10\n },\n button: {\n height: 52,\n borderRadius: 7,\n marginBottom: 32,\n marginTop: 16,\n backgroundColor: brandTheme?.colors?.primary || theme.colors.cta,\n justifyContent: 'center'\n },\n buttonText: {\n alignSelf: 'center',\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.large,\n color: '#fff'\n }\n });\n\nconst Tip = (props: TipProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const {Icon, text} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.tip}>\n <Icon height={16} width={16} style={styleSheet.icon} color={theme.colors.text.primary} />\n <Text style={styleSheet.tipText}>{text}</Text>\n </View>\n );\n};\n\nconst Onboarding = (props: OnboardingProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const {onPress} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.container}>\n <Html style={styleSheet.title}>{translations.appReview.presentation.title}</Html>\n <Html style={styleSheet.text}>{translations.appReview.presentation.text}</Html>\n\n <View style={styleSheet.tips}>\n <Tip Icon={TargetIcon} text={translations.appReview.presentation.labelList.skills.text} />\n <Tip\n Icon={QuestionMarkIcon}\n text={translations.appReview.presentation.labelList.questions.text}\n />\n <Tip Icon={HeartIcon} text={translations.appReview.presentation.labelList.lifes.text} />\n <Tip\n Icon={CheckCircle2Icon}\n text={translations.appReview.presentation.labelList.allright.text}\n />\n </View>\n <Touchable\n testID=\"button-quit-revision-onboarding\"\n onPress={onPress}\n analyticsID=\"button-start\"\n style={styleSheet.button}\n >\n <Text style={styleSheet.buttonText}>{translations.ok}</Text>\n </Touchable>\n </View>\n );\n};\n\nexport default Onboarding;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AACA;;;;;;;;AAgBA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAoBC,KAApB,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,eAAe,EAAEJ,KAAK,CAACK,MAAN,CAAaC,KADrB;IAETC,cAAc,EAAE,eAFP;IAGTC,IAAI,EAAE,CAHG;IA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1C;EAFhE,EAFF,eAME,6BAAC,GAAD;IAAK,IAAI,EAAE2C,sDAAX;IAAsB,IAAI,EAAET,YAAY,CAACE,SAAb,CAAuBC,YAAvB,CAAoCE,SAApC,CAA8CK,KAA9C,CAAoD5C;EAAhF,EANF,eAOE,6BAAC,GAAD;IACE,IAAI,EAAE6C,sCADR;IAEE,IAAI,EAAEX,YAAY,CAACE,SAAb,CAAuBC,YAAvB,CAAoCE,SAApC,CAA8CO,QAA9C,CAAuD9C;EAF/D,EAPF,CAJF,eAgBE,6BAAC,cAAD;IACE,MAAM,EAAC,iCADT;IAEE,OAAO,EAAEmC,OAFX;IAGE,WAAW,EAAC,cAHd;IAIE,KAAK,EAAER,UAAU,CAACR;EAJpB,gBAME,6BAAC,iBAAD;IAAM,KAAK,EAAEQ,UAAU,CAACN;EAAxB,GAAqCa,YAAY,CAACa,EAAlD,CANF,CAhBF,CADF;AA2BD,CA5CD;;eA8Ced,U"}
1
+ {"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","justifyContent","flex","padding","paddingTop","paddingBottom","title","height","width","fontSize","xxlarge","fontWeight","bold","lineHeight","color","text","primary","marginBottom","textContainer","marginTop","large","opacity","tips","tip","flexDirection","overflow","alignItems","borderRadius","gray","extra","spacing","micro","tipText","icon","margin","button","cta","buttonText","alignSelf","Tip","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","Icon","useEffect","_stylesheet","Onboarding","translations","onPress","appReview","presentation","TargetIcon","labelList","skills","QuestionMarkIcon","questions","HeartIcon","lifes","CheckCircle2Icon","allright","ok"],"sources":["../../../src/atom/review-presentation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionMarkIcon,\n NovaSolidStatusCheckCircle2 as CheckCircle2Icon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport Html from '../html/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {OnboardingProps, TipProps} from './prop-types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n title: TextStyle;\n text: TextStyle;\n textContainer: ViewStyle;\n tips: ViewStyle;\n tip: ViewStyle;\n tipText: TextStyle;\n icon: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n justifyContent: 'space-between',\n flex: 1,\n padding: 20,\n paddingTop: 20,\n paddingBottom: 100\n },\n title: {\n height: 72,\n width: 268,\n fontSize: theme.fontSize.xxlarge,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 36,\n color: theme.colors.text.primary,\n marginBottom: 32\n },\n textContainer: {\n marginTop: 8\n },\n text: {\n fontSize: theme.fontSize.large,\n color: theme.colors.text.primary,\n opacity: 0.7\n },\n tips: {\n marginTop: 32,\n height: 230,\n justifyContent: 'center'\n },\n tip: {\n flexDirection: 'row',\n overflow: 'hidden',\n alignItems: 'center',\n height: 54,\n borderRadius: 8,\n backgroundColor: theme.colors.gray.extra,\n marginTop: theme.spacing.micro,\n marginBottom: theme.spacing.micro\n },\n tipText: {\n fontSize: 16,\n lineHeight: 22,\n color: theme.colors.text.primary\n },\n icon: {\n margin: 10\n },\n button: {\n height: 52,\n borderRadius: 7,\n marginBottom: 32,\n marginTop: 16,\n backgroundColor: brandTheme?.colors?.primary || theme.colors.cta,\n justifyContent: 'center'\n },\n buttonText: {\n alignSelf: 'center',\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.large,\n color: '#fff'\n }\n });\n\nconst Tip = (props: TipProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const {Icon, text} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.tip}>\n <Icon height={16} width={16} style={styleSheet.icon} color={theme.colors.text.primary} />\n <Text style={styleSheet.tipText}>{text}</Text>\n </View>\n );\n};\n\nconst Onboarding = (props: OnboardingProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const {onPress} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.container}>\n <Html style={styleSheet.title}>{translations.appReview.presentation.title}</Html>\n\n <View style={styleSheet.textContainer}>\n <Html style={styleSheet.text}>{translations.appReview.presentation.text}</Html>\n </View>\n\n <View style={styleSheet.tips}>\n <Tip Icon={TargetIcon} text={translations.appReview.presentation.labelList.skills.text} />\n <Tip\n Icon={QuestionMarkIcon}\n text={translations.appReview.presentation.labelList.questions.text}\n />\n <Tip Icon={HeartIcon} text={translations.appReview.presentation.labelList.lifes.text} />\n <Tip\n Icon={CheckCircle2Icon}\n text={translations.appReview.presentation.labelList.allright.text}\n />\n </View>\n <Touchable\n testID=\"button-quit-revision-onboarding\"\n onPress={onPress}\n analyticsID=\"button-start\"\n style={styleSheet.button}\n >\n <Text style={styleSheet.buttonText}>{translations.ok}</Text>\n </Touchable>\n </View>\n );\n};\n\nexport default Onboarding;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AACA;;;;;;;;AAiBA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAA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gBACE,6BAAC,GAAD;IAAK,IAAI,EAAEgC,oDAAX;IAAuB,IAAI,EAAEJ,YAAY,CAACE,SAAb,CAAuBC,YAAvB,CAAoCE,SAApC,CAA8CC,MAA9C,CAAqDzC;EAAlF,EADF,eAEE,6BAAC,GAAD;IACE,IAAI,EAAE0C,0DADR;IAEE,IAAI,EAAEP,YAAY,CAACE,SAAb,CAAuBC,YAAvB,CAAoCE,SAApC,CAA8CG,SAA9C,CAAwD3C;EAFhE,EAFF,eAME,6BAAC,GAAD;IAAK,IAAI,EAAE4C,sDAAX;IAAsB,IAAI,EAAET,YAAY,CAACE,SAAb,CAAuBC,YAAvB,CAAoCE,SAApC,CAA8CK,KAA9C,CAAoD7C;EAAhF,EANF,eAOE,6BAAC,GAAD;IACE,IAAI,EAAE8C,sCADR;IAEE,IAAI,EAAEX,YAAY,CAACE,SAAb,CAAuBC,YAAvB,CAAoCE,SAApC,CAA8CO,QAA9C,CAAuD/C;EAF/D,EAPF,CAPF,eAmBE,6BAAC,cAAD;IACE,MAAM,EAAC,iCADT;IAEE,OAAO,EAAEoC,OAFX;IAGE,WAAW,EAAC,cAHd;IAIE,KAAK,EAAER,UAAU,CAACR;EAJpB,gBAME,6BAAC,iBAAD;IAAM,KAAK,EAAEQ,UAAU,CAACN;EAAxB,GAAqCa,YAAY,CAACa,EAAlD,CANF,CAnBF,CADF;AA8BD,CA/CD;;eAiDed,U"}
@@ -3,12 +3,14 @@
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,137 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.toggleStateOnKeyPress = exports.default = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _reactTooltip = _interopRequireDefault(require("react-tooltip"));
11
+
12
+ var _isString = _interopRequireDefault(require("lodash/fp/isString"));
13
+
14
+ var _novaIcons = require("@coorpacademy/nova-icons");
15
+
16
+ var _style = _interopRequireDefault(require("./style.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ 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); }
21
+
22
+ 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; }
23
+
24
+ const ToolTipWrapper = ({
25
+ toolTipIsVisible,
26
+ anchorId,
27
+ closeToolTipInformationTextAriaLabel,
28
+ content
29
+ }) => {
30
+ if (!toolTipIsVisible) return null;
31
+
32
+ if (anchorId) {
33
+ return /*#__PURE__*/_react.default.createElement(_reactTooltip.default, {
34
+ id: anchorId,
35
+ className: _style.default.toolTipReact,
36
+ "data-event-off": "click",
37
+ place: "left",
38
+ effect: "solid",
39
+ "aria-label": closeToolTipInformationTextAriaLabel
40
+ }, content);
41
+ } else {
42
+ return /*#__PURE__*/_react.default.createElement("div", {
43
+ className: _style.default.toolTip,
44
+ "data-testid": "tooltip",
45
+ "aria-label": closeToolTipInformationTextAriaLabel
46
+ }, content);
47
+ }
48
+ };
49
+
50
+ ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
51
+ toolTipIsVisible: _propTypes.default.bool,
52
+ anchorId: _propTypes.default.string,
53
+ closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
54
+ content: _propTypes.default.node
55
+ } : {};
56
+
57
+ const toggleStateOnKeyPress = (state, setState, ref) => event => {
58
+ if (event.key === 'Enter') {
59
+ if (ref) ref.current.focus();
60
+ event.stopPropagation();
61
+ event.preventDefault();
62
+ setState(!state);
63
+ } else if (event.key === 'Tab' || event.key === 'Escape') {
64
+ setState(false);
65
+ }
66
+ };
67
+
68
+ exports.toggleStateOnKeyPress = toggleStateOnKeyPress;
69
+
70
+ const ToolTip = ({
71
+ anchorId,
72
+ TooltipContent,
73
+ 'aria-label': ariaLabel,
74
+ 'data-testid': dataTestId,
75
+ closeToolTipInformationTextAriaLabel,
76
+ toolTipIsVisible: _toolTipIsVisible
77
+ }) => {
78
+ const isComponent = (0, _react.useMemo)(() => !(0, _isString.default)(TooltipContent) && /*#__PURE__*/(0, _react.isValidElement)(TooltipContent()), [TooltipContent]);
79
+ const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
80
+ const handleKeyPress = (0, _react.useCallback)(event => {
81
+ toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);
82
+ }, [toolTipIsVisible]);
83
+ const handleMouseOver = (0, _react.useCallback)(() => {
84
+ setToolTipIsVisible(true);
85
+ }, []);
86
+ const handleMouseLeave = (0, _react.useCallback)(() => {
87
+ setToolTipIsVisible(false);
88
+ }, []);
89
+ const content = (0, _react.useMemo)(() => {
90
+ return isComponent ? /*#__PURE__*/_react.default.createElement(TooltipContent, null) : /*#__PURE__*/_react.default.createElement("p", {
91
+ className: _style.default.tooltipContent
92
+ }, TooltipContent);
93
+ }, [TooltipContent, isComponent]);
94
+ return anchorId ? /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
95
+ toolTipIsVisible: _toolTipIsVisible,
96
+ anchorId: anchorId,
97
+ closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
98
+ content: content,
99
+ onMouseLeave: handleMouseLeave,
100
+ onMouseOver: handleMouseOver
101
+ }) : /*#__PURE__*/_react.default.createElement("div", {
102
+ className: _style.default.tooltipContainer,
103
+ onMouseLeave: handleMouseLeave,
104
+ onMouseOver: handleMouseOver
105
+ }, /*#__PURE__*/_react.default.createElement("button", {
106
+ type: "button",
107
+ className: _style.default.tooltipIconContainer,
108
+ "data-testid": dataTestId,
109
+ onKeyDown: handleKeyPress,
110
+ tabIndex: 0
111
+ }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
112
+ className: _style.default.informationIcon,
113
+ width: 12,
114
+ height: 12,
115
+ "aria-label": ariaLabel
116
+ })), /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
117
+ toolTipIsVisible: toolTipIsVisible,
118
+ anchorId: anchorId,
119
+ closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
120
+ content: content
121
+ }));
122
+ };
123
+
124
+ ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
125
+ TooltipContent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node, _propTypes.default.string]),
126
+ 'data-testid': _propTypes.default.string,
127
+ 'aria-label': _propTypes.default.string,
128
+ closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
129
+ // ---------- externalHandling --------------
130
+ // if passed down, React Tooltip is used instead, due to limitations on
131
+ // parents overflow hidden controls
132
+ anchorId: _propTypes.default.string,
133
+ toolTipIsVisible: _propTypes.default.bool
134
+ } : {};
135
+ var _default = ToolTip;
136
+ exports.default = _default;
137
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","style","toolTipReact","toolTip","propTypes","PropTypes","bool","string","isRequired","node","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","isComponent","useMemo","isString","isValidElement","setToolTipIsVisible","useState","handleKeyPress","useCallback","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;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,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,6BAAC,qBAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAEG,cAAA,CAAMC,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,EA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E,QAAQ,EAAEC,QAFZ;IAGE,oCAAoC,EAAEC,oCAHxC;IAIE,OAAO,EAAEC;EAJX,EAnBF,CAVF;AAqCD,CA3ED;;AA6EAoB,OAAO,CAAChB,SAAR,2CAAoB;EAClBiB,cAAc,EAAEhB,kBAAA,CAAUkC,SAAV,CAAoB,CAAClC,kBAAA,CAAUmC,IAAX,EAAiBnC,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;EACA;EACA;EACAV,QAAQ,EAAEO,kBAAA,CAAUE,MARF;EASlBV,gBAAgB,EAAEQ,kBAAA,CAAUC;AATV,CAApB;eAYec,O"}
@@ -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
+ }