@coorpacademy/components 11.4.4-alpha.2 → 11.4.5-alpha.32
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.
- package/es/atom/review-presentation/index.d.ts.map +1 -1
- package/es/atom/review-presentation/index.js +75 -18
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/prop-types.d.ts +4 -0
- package/es/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/es/atom/review-presentation/prop-types.js +2 -1
- package/es/atom/review-presentation/prop-types.js.map +1 -1
- package/es/atom/review-presentation/style.css +5 -14
- package/es/molecule/add-to-my-list/index.js +3 -1
- package/es/molecule/add-to-my-list/index.js.map +1 -1
- package/es/molecule/card/notification.js +3 -1
- package/es/molecule/card/notification.js.map +1 -1
- package/es/molecule/forum/forum-post/index.d.ts.map +1 -1
- package/es/molecule/forum/forum-post/index.js +2 -1
- package/es/molecule/forum/forum-post/index.js.map +1 -1
- package/es/molecule/share/index.d.ts.map +1 -1
- package/es/molecule/share/index.js +5 -1
- package/es/molecule/share/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +2 -2
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +2 -1
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/review-dashboard-skills/index.d.ts +4 -0
- package/lib/atom/review-presentation/index.d.ts.map +1 -1
- package/lib/atom/review-presentation/index.js +79 -18
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/prop-types.d.ts +4 -0
- package/lib/atom/review-presentation/prop-types.d.ts.map +1 -1
- package/lib/atom/review-presentation/prop-types.js +2 -1
- package/lib/atom/review-presentation/prop-types.js.map +1 -1
- package/lib/atom/review-presentation/style.css +5 -14
- package/lib/molecule/add-to-my-list/index.js +3 -1
- package/lib/molecule/add-to-my-list/index.js.map +1 -1
- package/lib/molecule/card/notification.js +3 -1
- package/lib/molecule/card/notification.js.map +1 -1
- package/lib/molecule/forum/forum-post/index.d.ts.map +1 -1
- package/lib/molecule/forum/forum-post/index.js +2 -1
- package/lib/molecule/forum/forum-post/index.js.map +1 -1
- package/lib/molecule/share/index.d.ts.map +1 -1
- package/lib/molecule/share/index.js +5 -1
- package/lib/molecule/share/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +2 -2
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +2 -1
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/review-dashboard-skills/index.d.ts +4 -0
- package/locales/.mtslconfig.json +1 -0
- package/locales/en/global.json +5 -1
- package/locales/fr/global.json +6 -1
- package/locales/ru/global.json +6 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";AAyGA,6DA+BC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
@@ -19,6 +19,12 @@ var _propTypes2 = _interopRequireDefault(require("./prop-types"));
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
+
|
|
22
28
|
const ICONS = {
|
|
23
29
|
skills: _novaIcons.NovaLineSelectionCursorsCursorArrowTarget,
|
|
24
30
|
questions: _novaIcons.NovaSolidInterfaceFeedbackInterfaceQuestionMark,
|
|
@@ -26,7 +32,9 @@ const ICONS = {
|
|
|
26
32
|
allright: _novaIcons.NovaSolidStatusCheckCircle2
|
|
27
33
|
};
|
|
28
34
|
|
|
29
|
-
const
|
|
35
|
+
const ReviewIcon = ({
|
|
36
|
+
icon
|
|
37
|
+
}) => {
|
|
30
38
|
const Icon = (0, _getOr.default)(null, icon, ICONS);
|
|
31
39
|
/* istanbul ignore next */
|
|
32
40
|
|
|
@@ -43,22 +51,67 @@ const getIcon = icon => {
|
|
|
43
51
|
|
|
44
52
|
const ToolTip = ({
|
|
45
53
|
tooltipText,
|
|
46
|
-
'aria-label': moreDetailsAriaLabel
|
|
54
|
+
'aria-label': moreDetailsAriaLabel,
|
|
55
|
+
'data-testid': dataTestId,
|
|
56
|
+
closeToolTipInformationTextAriaLabel
|
|
47
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]);
|
|
48
72
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
-
className: _style.default.tooltipContainer
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
52
82
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
|
|
53
83
|
className: _style.default.informationIcon,
|
|
54
84
|
width: 12,
|
|
55
85
|
height: 12,
|
|
56
86
|
"aria-label": moreDetailsAriaLabel
|
|
57
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
-
className: _style.default.toolTip
|
|
87
|
+
})), toolTipIsVisible ? /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
+
className: _style.default.toolTip,
|
|
89
|
+
"data-testid": "review-presentation-tooltip",
|
|
90
|
+
"aria-label": closeToolTipInformationTextAriaLabel
|
|
59
91
|
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
60
92
|
className: _style.default.tooltipText
|
|
61
|
-
}, tooltipText)));
|
|
93
|
+
}, tooltipText)) : null);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const ReviewListItemWrapper = ({
|
|
97
|
+
iconKey,
|
|
98
|
+
label
|
|
99
|
+
}) => {
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
+
className: _style.default.reviewListItemWrapper,
|
|
102
|
+
"data-tip": true,
|
|
103
|
+
"data-for": "reviewListItem",
|
|
104
|
+
tabIndex: 0
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
106
|
+
className: _style.default.reviewListText
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(ReviewIcon, {
|
|
108
|
+
icon: iconKey
|
|
109
|
+
}), " ", label.text), /*#__PURE__*/_react.default.createElement(ToolTip, {
|
|
110
|
+
tooltipText: label.tooltipText,
|
|
111
|
+
"aria-label": label.moreDetailsAriaLabel,
|
|
112
|
+
closeToolTipInformationTextAriaLabel: label.closeToolTipInformationTextAriaLabel,
|
|
113
|
+
"data-testid": `review-list-item-tooltip-button-${iconKey}`
|
|
114
|
+
}));
|
|
62
115
|
};
|
|
63
116
|
|
|
64
117
|
const ReviewPresentation = props => {
|
|
@@ -91,23 +144,31 @@ const ReviewPresentation = props => {
|
|
|
91
144
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
92
145
|
key: `step-${key}`,
|
|
93
146
|
className: _style.default.reviewList
|
|
94
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"data-for": "reviewListItem"
|
|
98
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
-
className: _style.default.reviewListText
|
|
100
|
-
}, getIcon(key), " ", label.text), /*#__PURE__*/_react.default.createElement(ToolTip, {
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement(ReviewListItemWrapper, {
|
|
148
|
+
iconKey: key,
|
|
149
|
+
label: label,
|
|
101
150
|
tooltipText: label.tooltipText,
|
|
102
151
|
"aria-label": label.moreDetailsAriaLabel
|
|
103
|
-
}))
|
|
152
|
+
}));
|
|
104
153
|
}, labelsList)));
|
|
105
154
|
};
|
|
106
155
|
|
|
107
156
|
ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
108
157
|
tooltipText: _propTypes.default.string,
|
|
109
|
-
'aria-label': _propTypes.default.string
|
|
158
|
+
'aria-label': _propTypes.default.string,
|
|
159
|
+
'data-testid': _propTypes.default.string,
|
|
160
|
+
closeToolTipInformationTextAriaLabel: _propTypes.default.string
|
|
161
|
+
} : {};
|
|
162
|
+
ReviewIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
163
|
+
icon: _propTypes.default.string
|
|
110
164
|
} : {};
|
|
165
|
+
ReviewListItemWrapper.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, ToolTip.propTypes, {
|
|
166
|
+
iconKey: _propTypes.default.string,
|
|
167
|
+
label: _propTypes.default.shape({
|
|
168
|
+
tooltipText: _propTypes.default.string,
|
|
169
|
+
moreDetailsAriaLabel: _propTypes.default.string
|
|
170
|
+
})
|
|
171
|
+
}) : {};
|
|
111
172
|
ReviewPresentation.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.default : {};
|
|
112
173
|
var _default = ReviewPresentation;
|
|
113
174
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ICONS","skills","TargetIcon","questions","QuestionIcon","lifes","HeartIcon","allright","CheckIcon","
|
|
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 })\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,IAAD;IAAM,SAAS,EAAED,cAAA,CAAMC;EAAvB,EAAP;AACD,CARD;;AAUA,MAAMC,OAAO,GAAG,CAAC;EACfC,WADe;EAEf,cAAcC,oBAFC;EAGf,eAAeC,UAHA;EAIfC;AAJe,CAAD,KAKV;EACJ,MAAM,CAACC,gBAAD,EAAmBC,mBAAnB,IAA0C,IAAAC,eAAA,EAAS,KAAT,CAAhD;EACA,MAAMC,cAAc,GAAG,IAAAC,kBAAA,EACrBC,KAAK,IAAI;IACP,IAAIA,KAAK,CAACC,GAAN,KAAc,OAAlB,EAA2B;MACzBL,mBAAmB,CAAC,CAACD,gBAAF,CAAnB;IACD,CAFD,MAEO,IAAIK,KAAK,CAACC,GAAN,KAAc,KAA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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;EAFX,CAAhB;AAHT;AASAf,kBAAkB,CAACa,SAAnB,2CAA+BA,mBAA/B;eAEeb,kB"}
|
|
@@ -10,21 +10,25 @@ declare const propTypes: {
|
|
|
10
10
|
text: PropTypes.Requireable<string>;
|
|
11
11
|
tooltipText: PropTypes.Requireable<string>;
|
|
12
12
|
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
13
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
13
14
|
}>>;
|
|
14
15
|
questions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
15
16
|
text: PropTypes.Requireable<string>;
|
|
16
17
|
tooltipText: PropTypes.Requireable<string>;
|
|
17
18
|
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
19
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
18
20
|
}>>;
|
|
19
21
|
lifes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
22
|
text: PropTypes.Requireable<string>;
|
|
21
23
|
tooltipText: PropTypes.Requireable<string>;
|
|
22
24
|
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
25
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
23
26
|
}>>;
|
|
24
27
|
allright: PropTypes.Requireable<PropTypes.InferProps<{
|
|
25
28
|
text: PropTypes.Requireable<string>;
|
|
26
29
|
tooltipText: PropTypes.Requireable<string>;
|
|
27
30
|
moreDetailsAreaLabel: PropTypes.Requireable<string>;
|
|
31
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
28
32
|
}>>;
|
|
29
33
|
}>>;
|
|
30
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/prop-types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/prop-types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAS1E,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,eAAO,MAAM,oBAAoB;;CAEhC,CAAC;AAEF,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE;QACX,MAAM,CAAC,EACH;YACE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YACjC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SACnC,GACD,SAAS,CAAC;QACd,SAAS,CAAC,EAAE;YACV,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YACjC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SACnC,CAAC;QACF,KAAK,CAAC,EACF;YACE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YACjC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SACnC,GACD,SAAS,CAAC;QACd,QAAQ,CAAC,EACL;YACE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YACjC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SACnC,GACD,SAAS,CAAC;KACf,CAAC;IACF,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAC,CAAC,CAAC;CACtF,CAAC"}
|
|
@@ -10,7 +10,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
10
10
|
const levelItem = _propTypes.default.shape({
|
|
11
11
|
text: _propTypes.default.string,
|
|
12
12
|
tooltipText: _propTypes.default.string,
|
|
13
|
-
moreDetailsAreaLabel: _propTypes.default.string
|
|
13
|
+
moreDetailsAreaLabel: _propTypes.default.string,
|
|
14
|
+
closeToolTipInformationTextAriaLabel: _propTypes.default.string
|
|
14
15
|
});
|
|
15
16
|
|
|
16
17
|
const propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["levelItem","PropTypes","shape","text","string","tooltipText","moreDetailsAreaLabel","propTypes","reviewTitle","reviewText","labelsList","skills","questions","lifes","allright","OnboardingPropsTypes","onPress","func","TipPropsTypes","Icon","any"],"sources":["../../../src/atom/review-presentation/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ColorValue, GestureResponderEvent, ViewStyle} from 'react-native';\n\nconst levelItem = PropTypes.shape({\n text: PropTypes.string,\n tooltipText: PropTypes.string,\n moreDetailsAreaLabel: PropTypes.string\n});\n\nconst propTypes = {\n 'aria-label': PropTypes.string,\n reviewTitle: PropTypes.string,\n reviewText: PropTypes.string,\n labelsList: PropTypes.shape({\n skills: levelItem,\n questions: levelItem,\n lifes: levelItem,\n allright: levelItem\n })\n};\n\nexport default propTypes;\n\nexport const OnboardingPropsTypes = {\n onPress: PropTypes.func\n};\n\nexport const TipPropsTypes = {\n text: PropTypes.string,\n Icon: PropTypes.any\n};\n\nexport type OnboardingProps = {\n 'aria-label'?: string | undefined;\n reviewTitle?: string | undefined;\n reviewText?: string | undefined;\n labelsList?: {\n skills?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n questions?: {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n };\n lifes?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n allright?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n };\n onPress: (event: GestureResponderEvent) => void;\n};\n\nexport type TipProps = {\n text: string | undefined;\n Icon: React.FC<{height: number; width: number; style: ViewStyle; color: ColorValue}>;\n};\n"],"mappings":";;;;;AAAA;;;;AAGA,MAAMA,SAAS,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAChCC,IAAI,EAAEF,kBAAA,CAAUG,MADgB;EAEhCC,WAAW,EAAEJ,kBAAA,CAAUG,MAFS;EAGhCE,oBAAoB,EAAEL,kBAAA,CAAUG;
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["levelItem","PropTypes","shape","text","string","tooltipText","moreDetailsAreaLabel","closeToolTipInformationTextAriaLabel","propTypes","reviewTitle","reviewText","labelsList","skills","questions","lifes","allright","OnboardingPropsTypes","onPress","func","TipPropsTypes","Icon","any"],"sources":["../../../src/atom/review-presentation/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ColorValue, GestureResponderEvent, ViewStyle} from 'react-native';\n\nconst levelItem = PropTypes.shape({\n text: PropTypes.string,\n tooltipText: PropTypes.string,\n moreDetailsAreaLabel: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string\n});\n\nconst propTypes = {\n 'aria-label': PropTypes.string,\n reviewTitle: PropTypes.string,\n reviewText: PropTypes.string,\n labelsList: PropTypes.shape({\n skills: levelItem,\n questions: levelItem,\n lifes: levelItem,\n allright: levelItem\n })\n};\n\nexport default propTypes;\n\nexport const OnboardingPropsTypes = {\n onPress: PropTypes.func\n};\n\nexport const TipPropsTypes = {\n text: PropTypes.string,\n Icon: PropTypes.any\n};\n\nexport type OnboardingProps = {\n 'aria-label'?: string | undefined;\n reviewTitle?: string | undefined;\n reviewText?: string | undefined;\n labelsList?: {\n skills?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n questions?: {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n };\n lifes?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n allright?:\n | {\n text?: string | undefined;\n tooltipText?: string | undefined;\n 'aria-label'?: string | undefined;\n }\n | undefined;\n };\n onPress: (event: GestureResponderEvent) => void;\n};\n\nexport type TipProps = {\n text: string | undefined;\n Icon: React.FC<{height: number; width: number; style: ViewStyle; color: ColorValue}>;\n};\n"],"mappings":";;;;;AAAA;;;;AAGA,MAAMA,SAAS,GAAGC,kBAAA,CAAUC,KAAV,CAAgB;EAChCC,IAAI,EAAEF,kBAAA,CAAUG,MADgB;EAEhCC,WAAW,EAAEJ,kBAAA,CAAUG,MAFS;EAGhCE,oBAAoB,EAAEL,kBAAA,CAAUG,MAHA;EAIhCG,oCAAoC,EAAEN,kBAAA,CAAUG;AAJhB,CAAhB,CAAlB;;AAOA,MAAMI,SAAS,GAAG;EAChB,cAAcP,kBAAA,CAAUG,MADR;EAEhBK,WAAW,EAAER,kBAAA,CAAUG,MAFP;EAGhBM,UAAU,EAAET,kBAAA,CAAUG,MAHN;EAIhBO,UAAU,EAAEV,kBAAA,CAAUC,KAAV,CAAgB;IAC1BU,MAAM,EAAEZ,SADkB;IAE1Ba,SAAS,EAAEb,SAFe;IAG1Bc,KAAK,EAAEd,SAHmB;IAI1Be,QAAQ,EAAEf;EAJgB,CAAhB;AAJI,CAAlB;eAYeQ,S;;AAER,MAAMQ,oBAAoB,GAAG;EAClCC,OAAO,EAAEhB,kBAAA,CAAUiB;AADe,CAA7B;;AAIA,MAAMC,aAAa,GAAG;EAC3BhB,IAAI,EAAEF,kBAAA,CAAUG,MADW;EAE3BgB,IAAI,EAAEnB,kBAAA,CAAUoB;AAFW,CAAtB"}
|
|
@@ -82,8 +82,6 @@
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.toolTip {
|
|
85
|
-
visibility: hidden;
|
|
86
|
-
opacity: 0;
|
|
87
85
|
transition: opacity 0.8s;
|
|
88
86
|
position: absolute;
|
|
89
87
|
height: auto;
|
|
@@ -97,8 +95,8 @@
|
|
|
97
95
|
.toolTip::before {
|
|
98
96
|
content: '';
|
|
99
97
|
display: inline-block;
|
|
100
|
-
visibility:
|
|
101
|
-
opacity:
|
|
98
|
+
visibility: inherit;
|
|
99
|
+
opacity: inherit;
|
|
102
100
|
width: 15px;
|
|
103
101
|
height: 15px;
|
|
104
102
|
transform: rotate(-45deg);
|
|
@@ -126,19 +124,12 @@
|
|
|
126
124
|
position: relative;
|
|
127
125
|
}
|
|
128
126
|
|
|
129
|
-
.reviewListItemWrapper:hover .tooltipContainer .toolTip {
|
|
130
|
-
visibility: visible;
|
|
131
|
-
opacity: 1;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.reviewListItemWrapper:hover .tooltipContainer .toolTip::before {
|
|
135
|
-
visibility: visible;
|
|
136
|
-
opacity: 1;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
127
|
.tooltipIconContainer {
|
|
140
128
|
display: flex;
|
|
141
129
|
justify-content: flex-end;
|
|
130
|
+
border: none;
|
|
131
|
+
background: cm_grey_75;
|
|
132
|
+
height: 25px;
|
|
142
133
|
}
|
|
143
134
|
|
|
144
135
|
@media tablet {
|
|
@@ -64,7 +64,9 @@ const AddToMyListFeedback = ({
|
|
|
64
64
|
className: _style.default.checkIcon,
|
|
65
65
|
width: 13,
|
|
66
66
|
height: 13
|
|
67
|
-
}), /*#__PURE__*/_react.default.createElement("p",
|
|
67
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
68
|
+
role: "status"
|
|
69
|
+
}, favorite ? addToMyListText : removeFromMyListText));
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
exports.AddToMyListFeedback = AddToMyListFeedback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","React","createContext","AddToMyListStatusProvider","children","status","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","useMemo","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","useContext","classnames","styles","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string","bool","func"],"sources":["../../../src/molecule/add-to-my-list/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionNavigationMore as MoreIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst ADD_TO_MY_LIST_STATUS = {\n IDLE: 'IDLE',\n SUCCESS: 'SUCCESS'\n};\n\nconst StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);\n\nexport const AddToMyListStatusProvider = ({children}) => {\n const [status, setStatus] = useState(ADD_TO_MY_LIST_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== ADD_TO_MY_LIST_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(ADD_TO_MY_LIST_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n const statusValue = useMemo(() => [status, setStatus], [status, setStatus]);\n return <StatusContext.Provider value={statusValue}>{children}</StatusContext.Provider>;\n};\n\nexport const AddToMyListFeedback = ({addToMyListText, removeFromMyListText, favorite}) => {\n const [status] = useContext(StatusContext);\n if (status === ADD_TO_MY_LIST_STATUS.IDLE) return null;\n\n return (\n <div className={classnames(styles.feedback)} data-name={'add-to-my-list-feedback'}>\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n <p>{favorite ? addToMyListText : removeFromMyListText}</p>\n </div>\n );\n};\n\nconst AddToMyList = ({style, addToMyListButton, favorite, onFavoriteClick}) => {\n const [, setStatus] = useContext(StatusContext);\n const cb = () => setStatus(ADD_TO_MY_LIST_STATUS.SUCCESS);\n\n function onClick() {\n onFavoriteClick(cb);\n }\n\n return (\n <div className={(styles.container, style)}>\n <Link data-name={'add-to-my-list-button'} onClick={onClick} className={styles.cta}>\n <div className={styles.wrapper}>\n {favorite ? (\n <CheckIcon className={styles.shareIcon} width={15} height={15} />\n ) : (\n <MoreIcon className={styles.shareIcon} width={12} height={12} />\n )}\n <p>{addToMyListButton}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nAddToMyListStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nAddToMyListFeedback.propTypes = {\n addToMyListText: PropTypes.string,\n removeFromMyListText: PropTypes.string,\n favorite: PropTypes.bool\n};\n\nAddToMyList.propTypes = {\n style: PropTypes.string,\n addToMyListButton: PropTypes.string,\n favorite: PropTypes.bool,\n onFavoriteClick: PropTypes.func\n};\n\nexport default AddToMyList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAIA;;AACA;;;;;;;;AAEA,MAAMA,qBAAqB,GAAG;EAC5BC,IAAI,EAAE,MADsB;EAE5BC,OAAO,EAAE;AAFmB,CAA9B;;AAKA,MAAMC,aAAa,gBAAGC,cAAA,CAAMC,aAAN,CAAoBL,qBAAqB,CAACC,IAA1C,CAAtB;;AAEO,MAAMK,yBAAyB,GAAG,CAAC;EAACC;AAAD,CAAD,KAAgB;EACvD,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,IAAAC,eAAA,EAASV,qBAAqB,CAACC,IAA/B,CAA5B;EACA,IAAAU,gBAAA,EAAU,MAAM;IACd,IAAIC,SAAJ;IACA,MAAMC,QAAQ,GAAG,IAAjB;;IACA,IAAIL,MAAM,KAAKR,qBAAqB,CAACC,IAArC,EAA2C;MACzCW,SAAS,GAAGE,UAAU,CAAC,MAAML,SAAS,CAACT,qBAAqB,CAACC,IAAvB,CAAhB,EAA8CY,QAA9C,CAAtB;IACD;;IACD,OAAO,MAAME,YAAY,CAACH,SAAD,CAAzB;EACD,CAPD,EAOG,CAACJ,MAAD,CAPH;EAQA,MAAMQ,WAAW,GAAG,IAAAC,cAAA,EAAQ,MAAM,CAACT,MAAD,EAASC,SAAT,CAAd,EAAmC,CAACD,MAAD,EAASC,SAAT,CAAnC,CAApB;EACA,oBAAO,6BAAC,aAAD,CAAe,QAAf;IAAwB,KAAK,EAAEO;EAA/B,GAA6CT,QAA7C,CAAP;AACD,CAZM;;;;AAcA,MAAMW,mBAAmB,GAAG,CAAC;EAACC,eAAD;EAAkBC,oBAAlB;EAAwCC;AAAxC,CAAD,KAAuD;EACxF,MAAM,CAACb,MAAD,IAAW,IAAAc,iBAAA,EAAWnB,aAAX,CAAjB;EACA,IAAIK,MAAM,KAAKR,qBAAqB,CAACC,IAArC,EAA2C,OAAO,IAAP;EAE3C,oBACE;IAAK,SAAS,EAAE,IAAAsB,mBAAA,EAAWC,cAAA,CAAOC,QAAlB,CAAhB;IAA6C,aAAW;EAAxD,gBACE,6BAAC,2CAAD;IAAW,SAAS,EAAED,cAAA,CAAOE,SAA7B;IAAwC,KAAK,EAAE,EAA/C;IAAmD,MAAM,EAAE;EAA3D,EADF,eAEE,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ADD_TO_MY_LIST_STATUS","IDLE","SUCCESS","StatusContext","React","createContext","AddToMyListStatusProvider","children","status","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","statusValue","useMemo","AddToMyListFeedback","addToMyListText","removeFromMyListText","favorite","useContext","classnames","styles","feedback","checkIcon","AddToMyList","style","addToMyListButton","onFavoriteClick","cb","onClick","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string","bool","func"],"sources":["../../../src/molecule/add-to-my-list/index.js"],"sourcesContent":["import React, {useState, useContext, useEffect, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionNavigationMore as MoreIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst ADD_TO_MY_LIST_STATUS = {\n IDLE: 'IDLE',\n SUCCESS: 'SUCCESS'\n};\n\nconst StatusContext = React.createContext(ADD_TO_MY_LIST_STATUS.IDLE);\n\nexport const AddToMyListStatusProvider = ({children}) => {\n const [status, setStatus] = useState(ADD_TO_MY_LIST_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== ADD_TO_MY_LIST_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(ADD_TO_MY_LIST_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n const statusValue = useMemo(() => [status, setStatus], [status, setStatus]);\n return <StatusContext.Provider value={statusValue}>{children}</StatusContext.Provider>;\n};\n\nexport const AddToMyListFeedback = ({addToMyListText, removeFromMyListText, favorite}) => {\n const [status] = useContext(StatusContext);\n if (status === ADD_TO_MY_LIST_STATUS.IDLE) return null;\n\n return (\n <div className={classnames(styles.feedback)} data-name={'add-to-my-list-feedback'}>\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n <p role=\"status\">{favorite ? addToMyListText : removeFromMyListText}</p>\n </div>\n );\n};\n\nconst AddToMyList = ({style, addToMyListButton, favorite, onFavoriteClick}) => {\n const [, setStatus] = useContext(StatusContext);\n const cb = () => setStatus(ADD_TO_MY_LIST_STATUS.SUCCESS);\n\n function onClick() {\n onFavoriteClick(cb);\n }\n\n return (\n <div className={(styles.container, style)}>\n <Link data-name={'add-to-my-list-button'} onClick={onClick} className={styles.cta}>\n <div className={styles.wrapper}>\n {favorite ? (\n <CheckIcon className={styles.shareIcon} width={15} height={15} />\n ) : (\n <MoreIcon className={styles.shareIcon} width={12} height={12} />\n )}\n <p>{addToMyListButton}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nAddToMyListStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nAddToMyListFeedback.propTypes = {\n addToMyListText: PropTypes.string,\n removeFromMyListText: PropTypes.string,\n favorite: PropTypes.bool\n};\n\nAddToMyList.propTypes = {\n style: PropTypes.string,\n addToMyListButton: PropTypes.string,\n favorite: PropTypes.bool,\n onFavoriteClick: PropTypes.func\n};\n\nexport default AddToMyList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAIA;;AACA;;;;;;;;AAEA,MAAMA,qBAAqB,G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F;EAG9BnB,QAAQ,EAAEiB,kBAAA,CAAUG;AAHU,CAAhC;AAMAd,WAAW,CAACU,SAAZ,2CAAwB;EACtBT,KAAK,EAAEU,kBAAA,CAAUE,MADK;EAEtBX,iBAAiB,EAAES,kBAAA,CAAUE,MAFP;EAGtBnB,QAAQ,EAAEiB,kBAAA,CAAUG,IAHE;EAItBX,eAAe,EAAEQ,kBAAA,CAAUI;AAJL,CAAxB;eAOef,W"}
|
|
@@ -51,7 +51,9 @@ const Notification = props => {
|
|
|
51
51
|
stroke: null
|
|
52
52
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
53
53
|
className: _notification.default.message
|
|
54
|
-
}, /*#__PURE__*/_react.default.createElement("span",
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
55
|
+
role: "status"
|
|
56
|
+
}, message))));
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
Notification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","names":["NOTIFICATION_ICON","addFavorite","CheckIcon","removeFavorite","MoreIcon","lock","LockIcon","unlock","UnlockIcon","handleOverlayClick","e","stopPropagation","preventDefault","Notification","props","message","icon","IconType","classnames","style","showOverlay","notificationWrapper","notification","propTypes","PropTypes","string","isRequired","oneOf"],"sources":["../../../src/molecule/card/notification.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, keys} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaSolidLoginLocked as LockIcon,\n NovaSolidLocksLockUnlock1 as UnlockIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport style from './notification.css';\n\nconst NOTIFICATION_ICON = {\n addFavorite: CheckIcon,\n removeFavorite: MoreIcon,\n lock: LockIcon,\n unlock: UnlockIcon\n};\n\nconst handleOverlayClick = e => {\n e.stopPropagation();\n e.preventDefault();\n return false;\n};\n\nconst Notification = props => {\n const {message, icon} = props;\n\n const IconType = get(icon, NOTIFICATION_ICON);\n return (\n <div\n data-name=\"notification\"\n data-type={icon}\n onClick={handleOverlayClick}\n className={classnames(style.showOverlay, style.notificationWrapper)}\n >\n <div className={style.notification}>\n <IconType className={style.icon} color={null} stroke={null} />\n <div className={style.message}>\n <span>{message}</span>\n </div>\n </div>\n </div>\n );\n};\nNotification.propTypes = {\n message: PropTypes.string.isRequired,\n icon: PropTypes.oneOf(keys(NOTIFICATION_ICON)).isRequired\n};\n\nexport default Notification;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAMA;;;;AAEA,MAAMA,iBAAiB,GAAG;EACxBC,WAAW,EAAEC,2CADW;EAExBC,cAAc,EAAEC,wCAFQ;EAGxBC,IAAI,EAAEC,+BAHkB;EAIxBC,MAAM,EAAEC;AAJgB,CAA1B;;AAOA,MAAMC,kBAAkB,GAAGC,CAAC,IAAI;EAC9BA,CAAC,CAACC,eAAF;EACAD,CAAC,CAACE,cAAF;EACA,OAAO,KAAP;AACD,CAJD;;AAMA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAkBF,KAAxB;EAEA,MAAMG,QAAQ,GAAG,mBAAID,IAAJ,EAAUhB,iBAAV,CAAjB;EACA,oBACE;IACE,aAAU,cADZ;IAEE,aAAWgB,IAFb;IAGE,OAAO,EAAEP,kBAHX;IAIE,SAAS,EAAE,IAAAS,mBAAA,EAAWC,qBAAA,CAAMC,WAAjB,EAA8BD,qBAAA,CAAME,mBAApC;EAJb,gBAME;IAAK,SAAS,EAAEF,qBAAA,CAAMG;EAAtB,gBACE,6BAAC,QAAD;IAAU,SAAS,EAAEH,qBAAA,CAAMH,IAA3B;IAAiC,KAAK,EAAE,IAAxC;IAA8C,MAAM,EAAE;EAAtD,EADF,eAEE;IAAK,SAAS,EAAEG,qBAAA,CAAMJ;EAAtB,gBACE,
|
|
1
|
+
{"version":3,"file":"notification.js","names":["NOTIFICATION_ICON","addFavorite","CheckIcon","removeFavorite","MoreIcon","lock","LockIcon","unlock","UnlockIcon","handleOverlayClick","e","stopPropagation","preventDefault","Notification","props","message","icon","IconType","classnames","style","showOverlay","notificationWrapper","notification","propTypes","PropTypes","string","isRequired","oneOf"],"sources":["../../../src/molecule/card/notification.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, keys} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaSolidLoginLocked as LockIcon,\n NovaSolidLocksLockUnlock1 as UnlockIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport style from './notification.css';\n\nconst NOTIFICATION_ICON = {\n addFavorite: CheckIcon,\n removeFavorite: MoreIcon,\n lock: LockIcon,\n unlock: UnlockIcon\n};\n\nconst handleOverlayClick = e => {\n e.stopPropagation();\n e.preventDefault();\n return false;\n};\n\nconst Notification = props => {\n const {message, icon} = props;\n\n const IconType = get(icon, NOTIFICATION_ICON);\n return (\n <div\n data-name=\"notification\"\n data-type={icon}\n onClick={handleOverlayClick}\n className={classnames(style.showOverlay, style.notificationWrapper)}\n >\n <div className={style.notification}>\n <IconType className={style.icon} color={null} stroke={null} />\n <div className={style.message}>\n <span role=\"status\">{message}</span>\n </div>\n </div>\n </div>\n );\n};\nNotification.propTypes = {\n message: PropTypes.string.isRequired,\n icon: PropTypes.oneOf(keys(NOTIFICATION_ICON)).isRequired\n};\n\nexport default Notification;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAMA;;;;AAEA,MAAMA,iBAAiB,GAAG;EACxBC,WAAW,EAAEC,2CADW;EAExBC,cAAc,EAAEC,wCAFQ;EAGxBC,IAAI,EAAEC,+BAHkB;EAIxBC,MAAM,EAAEC;AAJgB,CAA1B;;AAOA,MAAMC,kBAAkB,GAAGC,CAAC,IAAI;EAC9BA,CAAC,CAACC,eAAF;EACAD,CAAC,CAACE,cAAF;EACA,OAAO,KAAP;AACD,CAJD;;AAMA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAkBF,KAAxB;EAEA,MAAMG,QAAQ,GAAG,mBAAID,IAAJ,EAAUhB,iBAAV,CAAjB;EACA,oBACE;IACE,aAAU,cADZ;IAEE,aAAWgB,IAFb;IAGE,OAAO,EAAEP,kBAHX;IAIE,SAAS,EAAE,IAAAS,mBAAA,EAAWC,qBAAA,CAAMC,WAAjB,EAA8BD,qBAAA,CAAME,mBAApC;EAJb,gBAME;IAAK,SAAS,EAAEF,qBAAA,CAAMG;EAAtB,gBACE,6BAAC,QAAD;IAAU,SAAS,EAAEH,qBAAA,CAAMH,IAA3B;IAAiC,KAAK,EAAE,IAAxC;IAA8C,MAAM,EAAE;EAAtD,EADF,eAEE;IAAK,SAAS,EAAEG,qBAAA,CAAMJ;EAAtB,gBACE;IAAM,IAAI,EAAC;EAAX,GAAqBA,OAArB,CADF,CAFF,CANF,CADF;AAeD,CAnBD;;AAoBAF,YAAY,CAACU,SAAb,2CAAyB;EACvBR,OAAO,EAAES,kBAAA,CAAUC,MAAV,CAAiBC,UADH;EAEvBV,IAAI,EAAEQ,kBAAA,CAAUG,KAAV,CAAgB,oBAAK3B,iBAAL,CAAhB,EAAyC0B;AAFxB,CAAzB;eAKeb,Y"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/forum/forum-post/index.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/forum/forum-post/index.js"],"names":[],"mappings":";AAUA,kEAkJC"}
|
|
@@ -127,7 +127,8 @@ const ForumPost = (props, context) => {
|
|
|
127
127
|
display: rejectable ? 'block' : 'none'
|
|
128
128
|
}
|
|
129
129
|
}, rejected ? putBackLabel : rejectLabel), /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
-
className: messageClassName
|
|
130
|
+
className: messageClassName,
|
|
131
|
+
role: "status"
|
|
131
132
|
}, deleted ? infoDeleted : message), /*#__PURE__*/_react.default.createElement("div", {
|
|
132
133
|
className: `${_style.default.edition} ${showEditBox ? _style.default.visible : ''}`
|
|
133
134
|
}, /*#__PURE__*/_react.default.createElement(_forumComment.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ForumPost","props","context","translate","skin","id","author","avatar","avatarAlt","profileAvatarAlt","date","message","answer","answerPostDisabled","answerTextareaDisabled","answerAvatar","answerable","editable","rejectable","mainPost","rejected","deleted","edition","editionPostDisabled","editionTextareaDisabled","showAnswerBox","showEditBox","onAnswer","onEdit","onPostAnswer","onPostEdition","onChangeAnswer","onChangeEdition","onModerate","onDelete","color","infoDeleted","answerLabel","editLabel","deleteLabel","rejectLabel","putBackLabel","messageClassName","style","deletedMessage","hiddenMessage","classnames","post","avatarWrapper","image","content","body","action","display","visible","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","SrcPropType","bool","func"],"sources":["../../../../src/molecule/forum/forum-post/index.js"],"sourcesContent":["import React from 'react';\nimport {get, identity} from 'lodash/fp';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {SrcPropType} from '../../../util/proptypes';\nimport Provider from '../../../atom/provider';\nimport Picture from '../../../atom/picture';\nimport ForumComment from '../forum-comment';\nimport style from './style.css';\n\nconst ForumPost = (props, context) => {\n const {translate, skin} = context;\n const {\n id,\n author,\n avatar,\n avatarAlt,\n profileAvatarAlt,\n date,\n message,\n answer,\n answerPostDisabled = false,\n answerTextareaDisabled = false,\n answerAvatar,\n answerable = true,\n editable = false,\n rejectable = false,\n mainPost = false,\n rejected = false,\n deleted = false,\n edition,\n editionPostDisabled = false,\n editionTextareaDisabled = false,\n showAnswerBox = false,\n showEditBox = false,\n onAnswer = identity,\n onEdit = identity,\n onPostAnswer = identity,\n onPostEdition = identity,\n onChangeAnswer = identity,\n onChangeEdition = identity,\n onModerate,\n onDelete\n } = props;\n const color = get('common.primary', skin);\n\n const infoDeleted = translate('This message has been removed by its author');\n const answerLabel = translate('Answer');\n const editLabel = translate('Edit');\n const deleteLabel = translate('Delete');\n const rejectLabel = translate('Reject');\n const putBackLabel = translate('Put back');\n let messageClassName = style.message;\n if (deleted) {\n messageClassName = style.deletedMessage;\n } else if (showEditBox) {\n messageClassName = style.hiddenMessage;\n }\n\n return (\n <div\n data-name=\"forumPost\"\n id={`forum-post-${id || 'to-be-posted'}`}\n className={classnames(\n mainPost ? style.mainPost : null,\n rejected ? style.rejected : style.post\n )}\n >\n <div className={style.avatarWrapper}>\n <div className={style.image}>\n <Picture src={avatar} className={style.avatar} alt={avatarAlt} />\n </div>\n <span data-name=\"author\" className={style.author}>\n {author}\n </span>\n </div>\n <div className={style.content}>\n <div>\n <span className={style.date}>{date}</span>\n </div>\n <div className={style.body}>\n <span\n className={style.action}\n onClick={onAnswer}\n style={{\n color,\n display: answerable && !deleted && !rejected ? 'block' : 'none'\n }}\n >\n {answerLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onEdit}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {editLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onDelete}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {deleteLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onModerate}\n style={{\n color,\n display: rejectable ? 'block' : 'none'\n }}\n >\n {rejected ? putBackLabel : rejectLabel}\n </span>\n\n <div className={messageClassName}>{deleted ? infoDeleted : message}</div>\n\n <div className={`${style.edition} ${showEditBox ? style.visible : ''}`}>\n <ForumComment\n avatar={null}\n profileAvatarAlt={profileAvatarAlt}\n value={edition}\n textareaDisabled={editionTextareaDisabled}\n postDisabled={editionPostDisabled}\n onPost={onPostEdition}\n onChange={onChangeEdition}\n />\n </div>\n\n <div className={`${style.answer} ${showAnswerBox ? style.visible : ''}`}>\n <ForumComment\n avatar={answerAvatar}\n profileAvatarAlt={profileAvatarAlt}\n textareaDisabled={answerTextareaDisabled}\n postDisabled={answerPostDisabled}\n value={answer}\n onPost={onPostAnswer}\n onChange={onChangeAnswer}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nForumPost.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nForumPost.propTypes = {\n id: PropTypes.string,\n author: PropTypes.string,\n avatarAlt: PropTypes.string,\n profileAvatarAlt: PropTypes.string,\n date: PropTypes.string,\n message: PropTypes.string,\n avatar: SrcPropType,\n answerAvatar: SrcPropType,\n answer: PropTypes.string,\n edition: PropTypes.string,\n showAnswerBox: PropTypes.bool,\n showEditBox: PropTypes.bool,\n mainPost: PropTypes.bool,\n onAnswer: PropTypes.func,\n onEdit: PropTypes.func,\n onPostAnswer: PropTypes.func,\n onPostEdition: PropTypes.func,\n onChangeAnswer: PropTypes.func,\n onChangeEdition: PropTypes.func,\n onModerate: PropTypes.func,\n onDelete: PropTypes.func,\n answerPostDisabled: PropTypes.bool,\n answerTextareaDisabled: PropTypes.bool,\n answerable: PropTypes.bool,\n editable: PropTypes.bool,\n rejectable: PropTypes.bool,\n rejected: PropTypes.bool,\n deleted: PropTypes.bool,\n editionPostDisabled: PropTypes.bool,\n editionTextareaDisabled: PropTypes.bool\n};\n\nexport default ForumPost;\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EACA,MAAM;IACJG,EADI;IAEJC,MAFI;IAGJC,MAHI;IAIJC,SAJI;IAKJC,gBALI;IAMJC,IANI;IAOJC,OAPI;IAQJC,MARI;IASJC,kBAAkB,GAAG,KATjB;IAUJC,sBAAsB,G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,kBAAA,CAAUG;AA9Bf,CAAtB;eAiCe9D,S"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ForumPost","props","context","translate","skin","id","author","avatar","avatarAlt","profileAvatarAlt","date","message","answer","answerPostDisabled","answerTextareaDisabled","answerAvatar","answerable","editable","rejectable","mainPost","rejected","deleted","edition","editionPostDisabled","editionTextareaDisabled","showAnswerBox","showEditBox","onAnswer","onEdit","onPostAnswer","onPostEdition","onChangeAnswer","onChangeEdition","onModerate","onDelete","color","infoDeleted","answerLabel","editLabel","deleteLabel","rejectLabel","putBackLabel","messageClassName","style","deletedMessage","hiddenMessage","classnames","post","avatarWrapper","image","content","body","action","display","visible","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","SrcPropType","bool","func"],"sources":["../../../../src/molecule/forum/forum-post/index.js"],"sourcesContent":["import React from 'react';\nimport {get, identity} from 'lodash/fp';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {SrcPropType} from '../../../util/proptypes';\nimport Provider from '../../../atom/provider';\nimport Picture from '../../../atom/picture';\nimport ForumComment from '../forum-comment';\nimport style from './style.css';\n\nconst ForumPost = (props, context) => {\n const {translate, skin} = context;\n const {\n id,\n author,\n avatar,\n avatarAlt,\n profileAvatarAlt,\n date,\n message,\n answer,\n answerPostDisabled = false,\n answerTextareaDisabled = false,\n answerAvatar,\n answerable = true,\n editable = false,\n rejectable = false,\n mainPost = false,\n rejected = false,\n deleted = false,\n edition,\n editionPostDisabled = false,\n editionTextareaDisabled = false,\n showAnswerBox = false,\n showEditBox = false,\n onAnswer = identity,\n onEdit = identity,\n onPostAnswer = identity,\n onPostEdition = identity,\n onChangeAnswer = identity,\n onChangeEdition = identity,\n onModerate,\n onDelete\n } = props;\n const color = get('common.primary', skin);\n\n const infoDeleted = translate('This message has been removed by its author');\n const answerLabel = translate('Answer');\n const editLabel = translate('Edit');\n const deleteLabel = translate('Delete');\n const rejectLabel = translate('Reject');\n const putBackLabel = translate('Put back');\n let messageClassName = style.message;\n if (deleted) {\n messageClassName = style.deletedMessage;\n } else if (showEditBox) {\n messageClassName = style.hiddenMessage;\n }\n\n return (\n <div\n data-name=\"forumPost\"\n id={`forum-post-${id || 'to-be-posted'}`}\n className={classnames(\n mainPost ? style.mainPost : null,\n rejected ? style.rejected : style.post\n )}\n >\n <div className={style.avatarWrapper}>\n <div className={style.image}>\n <Picture src={avatar} className={style.avatar} alt={avatarAlt} />\n </div>\n <span data-name=\"author\" className={style.author}>\n {author}\n </span>\n </div>\n <div className={style.content}>\n <div>\n <span className={style.date}>{date}</span>\n </div>\n <div className={style.body}>\n <span\n className={style.action}\n onClick={onAnswer}\n style={{\n color,\n display: answerable && !deleted && !rejected ? 'block' : 'none'\n }}\n >\n {answerLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onEdit}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {editLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onDelete}\n style={{\n color,\n display: editable ? 'block' : 'none'\n }}\n >\n {deleteLabel}\n </span>\n\n <span\n className={style.action}\n onClick={onModerate}\n style={{\n color,\n display: rejectable ? 'block' : 'none'\n }}\n >\n {rejected ? putBackLabel : rejectLabel}\n </span>\n\n <div className={messageClassName} role=\"status\">\n {deleted ? infoDeleted : message}\n </div>\n\n <div className={`${style.edition} ${showEditBox ? style.visible : ''}`}>\n <ForumComment\n avatar={null}\n profileAvatarAlt={profileAvatarAlt}\n value={edition}\n textareaDisabled={editionTextareaDisabled}\n postDisabled={editionPostDisabled}\n onPost={onPostEdition}\n onChange={onChangeEdition}\n />\n </div>\n\n <div className={`${style.answer} ${showAnswerBox ? style.visible : ''}`}>\n <ForumComment\n avatar={answerAvatar}\n profileAvatarAlt={profileAvatarAlt}\n textareaDisabled={answerTextareaDisabled}\n postDisabled={answerPostDisabled}\n value={answer}\n onPost={onPostAnswer}\n onChange={onChangeAnswer}\n />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nForumPost.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nForumPost.propTypes = {\n id: PropTypes.string,\n author: PropTypes.string,\n avatarAlt: PropTypes.string,\n profileAvatarAlt: PropTypes.string,\n date: PropTypes.string,\n message: PropTypes.string,\n avatar: SrcPropType,\n answerAvatar: SrcPropType,\n answer: PropTypes.string,\n edition: PropTypes.string,\n showAnswerBox: PropTypes.bool,\n showEditBox: PropTypes.bool,\n mainPost: PropTypes.bool,\n onAnswer: PropTypes.func,\n onEdit: PropTypes.func,\n onPostAnswer: PropTypes.func,\n onPostEdition: PropTypes.func,\n onChangeAnswer: PropTypes.func,\n onChangeEdition: PropTypes.func,\n onModerate: PropTypes.func,\n onDelete: PropTypes.func,\n answerPostDisabled: PropTypes.bool,\n answerTextareaDisabled: PropTypes.bool,\n answerable: PropTypes.bool,\n editable: PropTypes.bool,\n rejectable: PropTypes.bool,\n rejected: PropTypes.bool,\n deleted: PropTypes.bool,\n editionPostDisabled: PropTypes.bool,\n editionTextareaDisabled: PropTypes.bool\n};\n\nexport default ForumPost;\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,SAAD;IAAYC;EAAZ,IAAoBF,OAA1B;EACA,MAAM;IACJG,EADI;IAEJC,MAFI;IAGJC,MAHI;IAIJC,SAJI;IAKJC,gBALI;IAMJC,IANI;IAOJC,OAPI;IAQJC,MARI;IASJC,kBAAkB,GAAG,KATjB;IAUJC,sBAAsB,GAAG,KAVrB;IAWJC,YAXI;IAYJC,UAAU,GAAG,IAZT;IAaJC,QAAQ,GAAG,KAbP;IAcJC,UAAU,GAAG,KAdT;IAeJC,QAAQ,GAAG,KAfP;IAgBJC,QAAQ,GAAG,KAhBP;IAiBJC,OAAO,GAAG,KAjBN;IAkBJC,OAlBI;IAmBJC,mBAAmB,GAAG,KAnBlB;IAo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","sourceRoot":"","sources":["../../../src/molecule/share/index.js"],"names":[],"mappings":"AAkDO;;gBAcN;;;;;;AAEM;;;uBAoBN;;;;;;;;;;AAED;;;;gBA8BC"}
|
|
@@ -95,7 +95,11 @@ const ShareFeedback = ({
|
|
|
95
95
|
className: _style.default.checkIcon,
|
|
96
96
|
width: 13,
|
|
97
97
|
height: 13
|
|
98
|
-
}), /*#__PURE__*/_react.default.createElement("p",
|
|
98
|
+
}), status === SHARE_STATUS.SUCCESS ? /*#__PURE__*/_react.default.createElement("p", {
|
|
99
|
+
role: "status"
|
|
100
|
+
}, successWording) : /*#__PURE__*/_react.default.createElement("p", {
|
|
101
|
+
role: "alert"
|
|
102
|
+
}, errorWording));
|
|
99
103
|
};
|
|
100
104
|
|
|
101
105
|
exports.ShareFeedback = ShareFeedback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SHARE_STATUS","IDLE","ERROR","SUCCESS","copyTextViaExecCommand","text","textarea","document","createElement","style","border","padding","visibility","position","setAttribute","value","body","appendChild","status","select","setSelectionRange","length","execCommand","error","removeChild","StatusContext","React","createContext","ShareStatusProvider","children","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","useMemo","ShareFeedback","successWording","errorWording","useContext","classnames","styles","feedback","errorFeedback","checkIcon","Share","wording","onClick","useCallback","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string"],"sources":["../../../src/molecule/share/index.js"],"sourcesContent":["import React, {useState, useMemo, useCallback, useContext, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionCoorpacademyShare as ShareIcon,\n NovaCompositionCoorpacademyAttention as AttentionIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst SHARE_STATUS = {\n IDLE: 'IDLE',\n ERROR: 'ERROR',\n SUCCESS: 'SUCCESS'\n};\n\nconst copyTextViaExecCommand = text => {\n const textarea = document.createElement('textarea');\n\n textarea.style.border = '0';\n textarea.style.padding = '0';\n textarea.style.visibility = 'hidden';\n textarea.style.position = 'absolute';\n textarea.setAttribute('readonly', '');\n textarea.value = text;\n\n // Element.append is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-append\n document.body.appendChild(textarea);\n let status = SHARE_STATUS.IDLE;\n\n try {\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n document.execCommand('copy');\n status = SHARE_STATUS.SUCCESS;\n } catch (error) {\n status = SHARE_STATUS.ERROR;\n }\n\n // Element.remove is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-remove\n document.body.removeChild(textarea);\n\n return status;\n};\n\nconst StatusContext = React.createContext(SHARE_STATUS.IDLE);\n\nexport const ShareStatusProvider = ({children}) => {\n const [status, setStatus] = useState(SHARE_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== SHARE_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(SHARE_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n\n const value = useMemo(() => [status, setStatus], [status]);\n\n return <StatusContext.Provider value={value}>{children}</StatusContext.Provider>;\n};\n\nexport const ShareFeedback = ({successWording, errorWording}) => {\n const [status] = useContext(StatusContext);\n if (status === SHARE_STATUS.IDLE) return null;\n\n return (\n <div\n className={classnames(styles.feedback, status === SHARE_STATUS.ERROR && styles.errorFeedback)}\n >\n {status === SHARE_STATUS.SUCCESS ? (\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n ) : (\n <AttentionIcon className={styles.checkIcon} width={13} height={13} />\n )}\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["SHARE_STATUS","IDLE","ERROR","SUCCESS","copyTextViaExecCommand","text","textarea","document","createElement","style","border","padding","visibility","position","setAttribute","value","body","appendChild","status","select","setSelectionRange","length","execCommand","error","removeChild","StatusContext","React","createContext","ShareStatusProvider","children","setStatus","useState","useEffect","timeoutId","DURATION","setTimeout","clearTimeout","useMemo","ShareFeedback","successWording","errorWording","useContext","classnames","styles","feedback","errorFeedback","checkIcon","Share","wording","onClick","useCallback","browserSupportsClipboardWriteText","navigator","clipboard","writeText","copyStatus","container","cta","wrapper","shareIcon","propTypes","PropTypes","node","string"],"sources":["../../../src/molecule/share/index.js"],"sourcesContent":["import React, {useState, useMemo, useCallback, useContext, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaCompositionCoorpacademyShare as ShareIcon,\n NovaCompositionCoorpacademyAttention as AttentionIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport styles from './style.css';\n\nconst SHARE_STATUS = {\n IDLE: 'IDLE',\n ERROR: 'ERROR',\n SUCCESS: 'SUCCESS'\n};\n\nconst copyTextViaExecCommand = text => {\n const textarea = document.createElement('textarea');\n\n textarea.style.border = '0';\n textarea.style.padding = '0';\n textarea.style.visibility = 'hidden';\n textarea.style.position = 'absolute';\n textarea.setAttribute('readonly', '');\n textarea.value = text;\n\n // Element.append is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-append\n document.body.appendChild(textarea);\n let status = SHARE_STATUS.IDLE;\n\n try {\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n document.execCommand('copy');\n status = SHARE_STATUS.SUCCESS;\n } catch (error) {\n status = SHARE_STATUS.ERROR;\n }\n\n // Element.remove is not supported on IE11 :/\n // eslint-disable-next-line unicorn/prefer-node-remove\n document.body.removeChild(textarea);\n\n return status;\n};\n\nconst StatusContext = React.createContext(SHARE_STATUS.IDLE);\n\nexport const ShareStatusProvider = ({children}) => {\n const [status, setStatus] = useState(SHARE_STATUS.IDLE);\n useEffect(() => {\n let timeoutId;\n const DURATION = 3000;\n if (status !== SHARE_STATUS.IDLE) {\n timeoutId = setTimeout(() => setStatus(SHARE_STATUS.IDLE), DURATION);\n }\n return () => clearTimeout(timeoutId);\n }, [status]);\n\n const value = useMemo(() => [status, setStatus], [status]);\n\n return <StatusContext.Provider value={value}>{children}</StatusContext.Provider>;\n};\n\nexport const ShareFeedback = ({successWording, errorWording}) => {\n const [status] = useContext(StatusContext);\n if (status === SHARE_STATUS.IDLE) return null;\n\n return (\n <div\n className={classnames(styles.feedback, status === SHARE_STATUS.ERROR && styles.errorFeedback)}\n >\n {status === SHARE_STATUS.SUCCESS ? (\n <CheckIcon className={styles.checkIcon} width={13} height={13} />\n ) : (\n <AttentionIcon className={styles.checkIcon} width={13} height={13} />\n )}\n {status === SHARE_STATUS.SUCCESS ? (\n <p role=\"status\">{successWording}</p>\n ) : (\n <p role=\"alert\">{errorWording}</p>\n )}\n </div>\n );\n};\n\nconst Share = ({style, text, wording}) => {\n const [, setStatus] = useContext(StatusContext);\n const onClick = useCallback(async () => {\n const browserSupportsClipboardWriteText =\n 'clipboard' in navigator && 'writeText' in navigator.clipboard;\n if (browserSupportsClipboardWriteText) {\n try {\n await navigator.clipboard.writeText(text);\n setStatus(SHARE_STATUS.SUCCESS);\n } catch (error) {\n setStatus(SHARE_STATUS.ERROR);\n }\n return;\n } else {\n const copyStatus = copyTextViaExecCommand(text);\n setStatus(copyStatus);\n }\n return;\n }, [setStatus, text]);\n\n return (\n <div className={(styles.container, style)}>\n <Link onClick={onClick} className={styles.cta} data-name={'share-button'}>\n <div className={styles.wrapper}>\n <ShareIcon className={styles.shareIcon} width={18} height={18} />\n <p>{wording}</p>\n </div>\n </Link>\n </div>\n );\n};\n\nShareStatusProvider.propTypes = {\n children: PropTypes.node\n};\n\nShareFeedback.propTypes = {\n successWording: PropTypes.string,\n errorWording: PropTypes.string\n};\n\nShare.propTypes = {\n style: PropTypes.string,\n text: PropTypes.string,\n wording: PropTypes.string\n};\n\nexport default Share;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AAKA;;AACA;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eAEE,wCAAIX,OAAJ,CAFF,CADF,CADF,CADF;AAUD,CA9BD;;AAgCApB,mBAAmB,CAACgC,SAApB,2CAAgC;EAC9B/B,QAAQ,EAAEgC,kBAAA,CAAUC;AADU,CAAhC;AAIAxB,aAAa,CAACsB,SAAd,2CAA0B;EACxBrB,cAAc,EAAEsB,kBAAA,CAAUE,MADF;EAExBvB,YAAY,EAAEqB,kBAAA,CAAUE;AAFA,CAA1B;AAKAhB,KAAK,CAACa,SAAN,2CAAkB;EAChBnD,KAAK,EAAEoD,kBAAA,CAAUE,MADD;EAEhB1D,IAAI,EAAEwD,kBAAA,CAAUE,MAFA;EAGhBf,OAAO,EAAEa,kBAAA,CAAUE;AAHH,CAAlB;eAMehB,K"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAUA,mEAkDC"}
|
|
@@ -62,7 +62,8 @@ const SearchPage = (props, context) => {
|
|
|
62
62
|
"data-name": "searchResult",
|
|
63
63
|
className: _style.default.cardsWrapper
|
|
64
64
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
className: _style.default.title
|
|
65
|
+
className: _style.default.title,
|
|
66
|
+
role: "status"
|
|
66
67
|
}, title), cardsView));
|
|
67
68
|
};
|
|
68
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","skin","defaultColor","recommendationsView","cardsView","list","style","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","Filters","CardsGrid","Button","CardsList"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel\n } = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title}
|
|
1
|
+
{"version":3,"file":"index.js","names":["SearchPage","props","context","title","searchFilters","cards","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","skin","defaultColor","recommendationsView","cardsView","list","style","noresults","noresultstxt","clear","background","cardsWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","Filters","CardsGrid","Button","CardsList"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel\n } = props;\n\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n const cardsView = isEmpty(cards.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n return (\n <div>\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n />\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title} role=\"status\">\n {title}\n </div>\n {cardsView}\n </div>\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string\n};\n\nexport default SearchPage;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,KADI;IAEJC,aAFI;IAGJC,KAHI;IAIJC,cAJI;IAKJC,YALI;IAMJC,eANI;IAOJC,iBAPI;IAQJC;EARI,IASFT,KATJ;EAWA,MAAM;IAACU;EAAD,IAAST,OAAf;EACA,MAAMU,YAAY,GA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