@coorpacademy/components 11.38.3-alpha.14 → 11.38.3-alpha.19
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/input-search/index.d.ts.map +1 -1
- package/es/atom/input-search/index.js +12 -34
- package/es/atom/input-search/index.js.map +1 -1
- package/es/atom/input-search/style.css +0 -82
- package/es/molecule/card/customer.css +0 -3
- package/es/molecule/card/favorite.d.ts.map +1 -1
- package/es/molecule/card/favorite.js +5 -0
- package/es/molecule/card/favorite.js.map +1 -1
- package/es/molecule/card/index.d.ts.map +1 -1
- package/es/molecule/card/index.js +29 -11
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/notification.css +39 -16
- package/es/molecule/card/notification.d.ts.map +1 -1
- package/es/molecule/card/notification.js +26 -4
- package/es/molecule/card/notification.js.map +1 -1
- package/es/molecule/card/style.css +16 -14
- package/es/molecule/card-content/index.d.ts.map +1 -1
- package/es/molecule/card-content/index.js +79 -36
- package/es/molecule/card-content/index.js.map +1 -1
- package/es/molecule/card-content/style.css +32 -24
- package/es/molecule/external-content-button/style.css +1 -0
- package/es/molecule/search-form/index.d.ts +0 -1
- package/es/molecule/search-form/index.d.ts.map +1 -1
- package/es/molecule/search-form/index.js +16 -21
- package/es/molecule/search-form/index.js.map +1 -1
- package/es/molecule/search-form/style.css +6 -21
- package/es/organism/mooc-header/index.d.ts +0 -9
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +13 -124
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/mooc-header/style.css +8 -184
- package/es/util/check-is-mobile.js +2 -3
- package/es/util/check-is-mobile.js.map +1 -1
- package/es/util/external-content.d.ts +38 -4
- package/es/util/external-content.d.ts.map +1 -1
- package/es/util/external-content.js +33 -4
- package/es/util/external-content.js.map +1 -1
- package/es/variables/colors.d.ts +5 -0
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +6 -1
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/input-search/index.d.ts.map +1 -1
- package/lib/atom/input-search/index.js +12 -34
- package/lib/atom/input-search/index.js.map +1 -1
- package/lib/atom/input-search/style.css +0 -82
- package/lib/molecule/card/customer.css +0 -3
- package/lib/molecule/card/favorite.d.ts.map +1 -1
- package/lib/molecule/card/favorite.js +5 -0
- package/lib/molecule/card/favorite.js.map +1 -1
- package/lib/molecule/card/index.d.ts.map +1 -1
- package/lib/molecule/card/index.js +28 -10
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/notification.css +39 -16
- package/lib/molecule/card/notification.d.ts.map +1 -1
- package/lib/molecule/card/notification.js +25 -3
- package/lib/molecule/card/notification.js.map +1 -1
- package/lib/molecule/card/style.css +16 -14
- package/lib/molecule/card-content/index.d.ts.map +1 -1
- package/lib/molecule/card-content/index.js +77 -34
- package/lib/molecule/card-content/index.js.map +1 -1
- package/lib/molecule/card-content/style.css +32 -24
- package/lib/molecule/external-content-button/style.css +1 -0
- package/lib/molecule/search-form/index.d.ts +0 -1
- package/lib/molecule/search-form/index.d.ts.map +1 -1
- package/lib/molecule/search-form/index.js +17 -22
- package/lib/molecule/search-form/index.js.map +1 -1
- package/lib/molecule/search-form/style.css +6 -21
- package/lib/organism/mooc-header/index.d.ts +0 -9
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +13 -124
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/mooc-header/style.css +8 -184
- package/lib/util/check-is-mobile.js +2 -3
- package/lib/util/check-is-mobile.js.map +1 -1
- package/lib/util/external-content.d.ts +38 -4
- package/lib/util/external-content.d.ts.map +1 -1
- package/lib/util/external-content.js +34 -5
- package/lib/util/external-content.js.map +1 -1
- package/lib/variables/colors.d.ts +5 -0
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +6 -1
- package/lib/variables/colors.js.map +1 -1
- package/locales/en/global.json +4 -4
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,iDAkDC"}
|
|
@@ -6,10 +6,6 @@ import classnames from 'classnames';
|
|
|
6
6
|
import { NovaCompositionCoorpacademySearchThin as CMSearchIcon, NovaCompositionCoorpacademySearch as SearchIcon, NovaSolidStatusClose as CloseIcon } from '@coorpacademy/nova-icons';
|
|
7
7
|
import Provider from '../provider';
|
|
8
8
|
import style from './style.css';
|
|
9
|
-
const handleMouseDown = e => {
|
|
10
|
-
e.preventDefault();
|
|
11
|
-
e.stopPropagation();
|
|
12
|
-
};
|
|
13
9
|
const Search = props => {
|
|
14
10
|
const {
|
|
15
11
|
value,
|
|
@@ -22,41 +18,23 @@ const Search = props => {
|
|
|
22
18
|
dataTestId
|
|
23
19
|
} = props;
|
|
24
20
|
const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const isDefault = theme === 'default';
|
|
28
|
-
const wrapperClass = classnames({
|
|
29
|
-
[style.wrapperSearch]: isDefault,
|
|
30
|
-
[style.coorpmanager]: isCoorpManager,
|
|
31
|
-
[style.wrapperMooc]: isMooc
|
|
32
|
-
});
|
|
33
|
-
const wrapperParentClass = classnames({
|
|
34
|
-
[style.wrapperMoocParent]: isMooc
|
|
35
|
-
});
|
|
36
|
-
const searchClass = classnames({
|
|
37
|
-
[style.search]: true,
|
|
38
|
-
[style.moocSearch]: isMooc
|
|
39
|
-
});
|
|
40
|
-
const SearchIconComponent = isCoorpManager ? CMSearchIcon : SearchIcon;
|
|
41
|
-
const showTitle = isCoorpManager;
|
|
42
|
-
const showClearIcon = value && isCoorpManager;
|
|
21
|
+
const cmStyle = classnames(style.coorpmanager);
|
|
22
|
+
const isDefaultTheme = theme === 'default';
|
|
43
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className:
|
|
45
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
46
|
-
className: wrapperClass
|
|
24
|
+
className: isDefaultTheme ? style.wrapperSearch : cmStyle
|
|
47
25
|
}, /*#__PURE__*/React.createElement("label", {
|
|
48
26
|
htmlFor: "search",
|
|
49
27
|
title: placeholder
|
|
50
|
-
}, /*#__PURE__*/React.createElement(
|
|
51
|
-
className: style.searchIcon
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}),
|
|
28
|
+
}, !isDefaultTheme ? /*#__PURE__*/React.createElement(CMSearchIcon, {
|
|
29
|
+
className: style.searchIcon
|
|
30
|
+
}) : /*#__PURE__*/React.createElement(SearchIcon, {
|
|
31
|
+
className: style.searchIcon
|
|
32
|
+
}), !isDefaultTheme ? /*#__PURE__*/React.createElement("span", {
|
|
55
33
|
className: classnames(style.title, _isEmpty(value) && style.noValue)
|
|
56
34
|
}, placeholder) : null), /*#__PURE__*/React.createElement("input", {
|
|
57
35
|
"data-name": "search-input",
|
|
58
36
|
"data-testid": dataTestId,
|
|
59
|
-
className:
|
|
37
|
+
className: style.search,
|
|
60
38
|
"aria-label": placeholder,
|
|
61
39
|
type: "text",
|
|
62
40
|
name: "search",
|
|
@@ -68,10 +46,10 @@ const Search = props => {
|
|
|
68
46
|
onFocus: onFocus,
|
|
69
47
|
onChange: _noop,
|
|
70
48
|
onBlur: onBlur
|
|
71
|
-
}),
|
|
49
|
+
}), value && !isDefaultTheme ? /*#__PURE__*/React.createElement(CloseIcon, {
|
|
72
50
|
onClick: onClear,
|
|
73
51
|
className: style.clearIcon
|
|
74
|
-
}) : null)
|
|
52
|
+
}) : null);
|
|
75
53
|
};
|
|
76
54
|
Search.contextTypes = {
|
|
77
55
|
skin: Provider.childContextTypes.skin
|
|
@@ -83,7 +61,7 @@ Search.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
83
61
|
onClear: PropTypes.func,
|
|
84
62
|
onFocus: PropTypes.func,
|
|
85
63
|
onBlur: PropTypes.func,
|
|
86
|
-
theme: PropTypes.oneOf(['default', 'coorpmanager'
|
|
64
|
+
theme: PropTypes.oneOf(['default', 'coorpmanager']),
|
|
87
65
|
dataTestId: PropTypes.string
|
|
88
66
|
} : {};
|
|
89
67
|
export default Search;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","Search","props","value","placeholder","onChange","_noop","onClear","onFocus","onBlur","theme","dataTestId","handleChange","e","target","cmStyle","coorpmanager","isDefaultTheme","createElement","className","wrapperSearch","htmlFor","title","searchIcon","_isEmpty","noValue","search","type","name","id","onInput","onClick","clearIcon","contextTypes","skin","childContextTypes","propTypes","process","env","NODE_ENV","string","isRequired","func","oneOf"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default',\n dataTestId\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const cmStyle = classnames(style.coorpmanager);\n const isDefaultTheme = theme === 'default';\n\n return (\n <div className={isDefaultTheme ? style.wrapperSearch : cmStyle}>\n <label htmlFor=\"search\" title={placeholder}>\n {!isDefaultTheme ? (\n <CMSearchIcon className={style.searchIcon} />\n ) : (\n <SearchIcon className={style.searchIcon} />\n )}\n {!isDefaultTheme ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n data-testid={dataTestId}\n className={style.search}\n aria-label={placeholder}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n title={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {value && !isDefaultTheme ? (\n <CloseIcon onClick={onClear} className={style.clearIcon} />\n ) : null}\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager']),\n dataTestId: PropTypes.string\n};\n\nexport default Search;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qCAAqC,IAAIC,YAAY,EACrDC,iCAAiC,IAAIC,UAAU,EAC/CC,oBAAoB,IAAIC,SAAS,QAC5B,0BAA0B;AAEjC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,QAAQ,GAAAC,KAAO;IACfC,OAAO,GAAAD,KAAO;IACdE,OAAO;IACPC,MAAM;IACNC,KAAK,GAAG,SAAS;IACjBC;EACF,CAAC,GAAGT,KAAK;EACT,MAAMU,YAAY,GAA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AC,EACDN,KAAK,IAAI,CAACc,cAAc,gBACvB5B,KAAA,CAAA6B,aAAA,CAACpB,SAAS;IAACiC,OAAO,EAAExB,OAAQ;IAACY,SAAS,EAAEnB,KAAK,CAACgC;EAAU,CAAE,CAAC,GACzD,IACD,CAAC;AAEV,CAAC;AAED/B,MAAM,CAACgC,YAAY,GAAG;EACpBC,IAAI,EAAEnC,QAAQ,CAACoC,iBAAiB,CAACD;AACnC,CAAC;AAEDjC,MAAM,CAACmC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjBpC,KAAK,EAAEZ,SAAS,CAACiD,MAAM;EACvBpC,WAAW,EAAEb,SAAS,CAACiD,MAAM,CAACC,UAAU;EACxCpC,QAAQ,EAAEd,SAAS,CAACmD,IAAI;EACxBnC,OAAO,EAAEhB,SAAS,CAACmD,IAAI;EACvBlC,OAAO,EAAEjB,SAAS,CAACmD,IAAI;EACvBjC,MAAM,EAAElB,SAAS,CAACmD,IAAI;EACtBhC,KAAK,EAAEnB,SAAS,CAACoD,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;EACnDhC,UAAU,EAAEpB,SAAS,CAACiD;AACxB,CAAC;AAED,eAAevC,MAAM","ignoreList":[]}
|
|
@@ -8,13 +8,11 @@
|
|
|
8
8
|
@value white from colors;
|
|
9
9
|
@value dark from colors;
|
|
10
10
|
@value black from colors;
|
|
11
|
-
@value cm_grey_75 from colors;
|
|
12
11
|
@value cm_grey_100 from colors;
|
|
13
12
|
@value cm_grey_150 from colors;
|
|
14
13
|
@value cm_grey_400 from colors;
|
|
15
14
|
@value cm_grey_500 from colors;
|
|
16
15
|
@value cm_grey_700 from colors;
|
|
17
|
-
@value brand from colors;
|
|
18
16
|
|
|
19
17
|
.wrapperSearch {
|
|
20
18
|
display: flex;
|
|
@@ -68,7 +66,6 @@
|
|
|
68
66
|
color: medium;
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
/* Theme: coorpmanager */
|
|
72
69
|
.coorpmanager {
|
|
73
70
|
position: relative;
|
|
74
71
|
}
|
|
@@ -180,65 +177,6 @@
|
|
|
180
177
|
line-height: 16px;
|
|
181
178
|
}
|
|
182
179
|
|
|
183
|
-
/* Theme: mooc */
|
|
184
|
-
.wrapperMooc {
|
|
185
|
-
display: flex;
|
|
186
|
-
flex-flow: nowrap;
|
|
187
|
-
flex-direction: row;
|
|
188
|
-
align-items: center;
|
|
189
|
-
overflow: hidden;
|
|
190
|
-
border-radius: 12px;
|
|
191
|
-
transition: box-shadow 0.3s ease-in-out;
|
|
192
|
-
background: cm_grey_100;
|
|
193
|
-
padding: 2px;
|
|
194
|
-
width: 100%;
|
|
195
|
-
flex: 1;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.wrapperMoocParent {
|
|
199
|
-
width: 100%;
|
|
200
|
-
flex: 1;
|
|
201
|
-
border-radius: 12px;
|
|
202
|
-
transition: box-shadow 0.3s ease-in-out;
|
|
203
|
-
background: transparent;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.moocSearch {
|
|
207
|
-
background-color: cm_grey_100;
|
|
208
|
-
border-radius: 12px;
|
|
209
|
-
height: 44px;
|
|
210
|
-
margin: 0;
|
|
211
|
-
font-family: Gilroy;
|
|
212
|
-
font-size: 14px;
|
|
213
|
-
font-weight: 500;
|
|
214
|
-
color: cm_grey_700;
|
|
215
|
-
padding: 0 0 0 45px;
|
|
216
|
-
padding-right: 48px;
|
|
217
|
-
outline: none;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.moocSearch:focus-within {
|
|
221
|
-
background-color: cm_grey_75;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.wrapperMoocParent:focus-within .wrapperMooc {
|
|
225
|
-
background: transparent;
|
|
226
|
-
box-shadow: 0 0 0 2px rgba(255,255,255,0), 0 0 0 2px brand;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.wrapperMooc:hover {
|
|
230
|
-
box-shadow: 0 0 0 2px brand;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.wrapperMooc .clearIcon {
|
|
234
|
-
position: relative;
|
|
235
|
-
right: 26px;
|
|
236
|
-
color: cm_grey_400;
|
|
237
|
-
width: 14px;
|
|
238
|
-
height: 14px;
|
|
239
|
-
cursor: pointer;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
180
|
input:-webkit-autofill,
|
|
243
181
|
input:-webkit-autofill:hover,
|
|
244
182
|
input:-webkit-autofill:focus,
|
|
@@ -256,16 +194,6 @@ input:-webkit-autofill:active{
|
|
|
256
194
|
font-size: 12px;
|
|
257
195
|
color: medium;
|
|
258
196
|
}
|
|
259
|
-
|
|
260
|
-
.wrapperMoocParent {
|
|
261
|
-
max-width: 100%;
|
|
262
|
-
box-sizing: border-box;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.wrapperMooc {
|
|
266
|
-
max-width: 100%;
|
|
267
|
-
box-sizing: border-box;
|
|
268
|
-
}
|
|
269
197
|
}
|
|
270
198
|
|
|
271
199
|
@media mobile {
|
|
@@ -276,14 +204,4 @@ input:-webkit-autofill:active{
|
|
|
276
204
|
.search::placeholder {
|
|
277
205
|
font-size: 12px;
|
|
278
206
|
}
|
|
279
|
-
|
|
280
|
-
.wrapperMoocParent {
|
|
281
|
-
max-width: 100%;
|
|
282
|
-
box-sizing: border-box;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.wrapperMooc {
|
|
286
|
-
max-width: 100%;
|
|
287
|
-
box-sizing: border-box;
|
|
288
|
-
}
|
|
289
207
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/favorite.js"],"names":[],"mappings":";AAcA;;;;;;;;
|
|
1
|
+
{"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/favorite.js"],"names":[],"mappings":";AAcA;;;;;;;;oCA6IC"}
|
|
@@ -33,11 +33,16 @@ const Favorite = ({
|
|
|
33
33
|
const buttonRef = useRef(null);
|
|
34
34
|
const allowToolTip = useMemo(() => !_isEmpty(removeFavoriteToolTip) && !_isEmpty(addFavoriteToolTip), [addFavoriteToolTip, removeFavoriteToolTip]);
|
|
35
35
|
|
|
36
|
+
// eslint-disable-next-line no-console
|
|
37
|
+
console.log('🚀 ~ favorite.js:49 ~ allowToolTip:', allowToolTip);
|
|
38
|
+
|
|
36
39
|
// to be replaced by useId when React17 is bumped to React18
|
|
37
40
|
const [favoriteButtonAnchorId] = useState(allowToolTip ? uuidV5('engaged-battle-', uuidV5.URL) : undefined);
|
|
38
41
|
const toolTipContent = useMemo(
|
|
39
42
|
// eslint-disable-next-line no-nested-ternary
|
|
40
43
|
() => allowToolTip ? favorite ? removeFavoriteToolTip : addFavoriteToolTip : null, [addFavoriteToolTip, favorite, removeFavoriteToolTip, allowToolTip]);
|
|
44
|
+
// eslint-disable-next-line no-console
|
|
45
|
+
console.log('🚀 ~ favorite.js:63 ~ toolTipContent:', toolTipContent);
|
|
41
46
|
const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);
|
|
42
47
|
const [toolTipIsVisible, setToolTipIsVisible] = useState(false);
|
|
43
48
|
const handleMouseOver = useCallback(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorite.js","names":["React","useCallback","useMemo","useRef","useState","PropTypes","classnames","v5","uuidV5","NovaCompositionNavigationMore","MoreIcon","NovaCompositionCoorpacademyCheck","CheckIcon","Provider","GetSkinFromContext","GetTranslateFromContext","ToolTip","toggleStateOnKeyPress","Button","style","Favorite","favorite","addFavoriteToolTip","removeFavoriteToolTip","className","ariaLabel","onFavoriteClick","_noop","disabled","legacyContext","skin","translate","handleFavoriteClick","e","stopPropagation","preventDefault","primaryColor","_get","darkColor","brandColor","buttonRef","allowToolTip","_isEmpty","favoriteButtonAnchorId","URL","undefined","toolTipContent","mouseLeaveTimer","setMouseLeaveTimer","toolTipIsVisible","setToolTipIsVisible","handleMouseOver","clearTimeout","_has","current","focus","handleMouseLeave","setTimeout","blur","handleKeyPress","event","iconWrapperClassName","selected","icon","createElement","checkIcon","color","width","height","removeFromFavorite","moreIcon","addToFavorite","favoriteWrapper","type","buttonContentClassName","onClick","onKeyDown","onMouseLeave","onMouseOver","tabIndex","useButtonTag","useWrapper","fontSize","anchorId","TooltipContent","closeToolTipInformationTextAriaLabel","stickyOnKeyboardNavigation","propTypes","process","env","NODE_ENV","string","bool","func","shape","contextTypes","childContextTypes"],"sources":["../../../src/molecule/card/favorite.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {v5 as uuidV5} from 'uuid';\nimport {get, has, isEmpty, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Button from '../../atom/button';\nimport style from './favorite.css';\n\nconst Favorite = (\n {\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n className,\n 'aria-label': ariaLabel = {},\n onFavoriteClick = noop,\n disabled\n },\n legacyContext\n) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const handleFavoriteClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n if (!disabled) onFavoriteClick(e);\n },\n [disabled, onFavoriteClick]\n );\n\n const primaryColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const brandColor = get('common.brand', skin);\n\n const buttonRef = useRef(null);\n\n const allowToolTip = useMemo(\n () => !isEmpty(removeFavoriteToolTip) && !isEmpty(addFavoriteToolTip),\n [addFavoriteToolTip, removeFavoriteToolTip]\n );\n\n // to be replaced by useId when React17 is bumped to React18\n const [favoriteButtonAnchorId] = useState(\n allowToolTip ? uuidV5('engaged-battle-', uuidV5.URL) : undefined\n );\n\n const toolTipContent = useMemo(\n // eslint-disable-next-line no-nested-ternary\n () => (allowToolTip ? (favorite ? removeFavoriteToolTip : addFavoriteToolTip) : null),\n [addFavoriteToolTip, favorite, removeFavoriteToolTip, allowToolTip]\n );\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n /* istanbul ignore next */ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(\n setTimeout(() => {\n setToolTipIsVisible(false);\n // @ts-expect-error (error: blur does not exists on type never)\n /* istanbul ignore next */ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();\n }, 500)\n );\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const iconWrapperClassName = useMemo(\n () => classnames(style.favorite, className, favorite && style.selected),\n [className, favorite]\n );\n const icon = useMemo(\n () =>\n favorite ? (\n <CheckIcon\n // eslint-disable-next-line css-modules/no-undef-class\n className={style.checkIcon}\n style={{color: brandColor}}\n width={13}\n height={13}\n data-testid=\"favorite-check-icon\"\n aria-label={ariaLabel.removeFromFavorite}\n />\n ) : (\n <MoreIcon\n className={style.moreIcon}\n style={{color: darkColor}}\n width={13}\n height={13}\n data-testid=\"favorite-add-icon\"\n aria-label={ariaLabel.addToFavorite}\n />\n ),\n [ariaLabel.addToFavorite, ariaLabel.removeFromFavorite, brandColor, darkColor, favorite]\n );\n\n return (\n <div className={style.favoriteWrapper} data-testid=\"favorite-wrapper\">\n <Button\n buttonRef={buttonRef}\n type=\"button\"\n data-for={favoriteButtonAnchorId}\n data-tooltip-place=\"left\"\n data-tip={allowToolTip}\n data-name=\"favorite\"\n data-testid=\"favorite-button\"\n aria-label={ariaLabel.favorite}\n buttonContentClassName={iconWrapperClassName}\n onClick={handleFavoriteClick}\n style={{\n color: primaryColor\n }}\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n tabIndex={0}\n useButtonTag\n useWrapper={false}\n >\n {icon}\n </Button>\n <ToolTip\n fontSize={12}\n anchorId={favoriteButtonAnchorId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={toolTipContent}\n closeToolTipInformationTextAriaLabel={translate('close_tooltip_information')}\n stickyOnKeyboardNavigation\n />\n </div>\n );\n};\n\nFavorite.propTypes = {\n className: PropTypes.string,\n favorite: PropTypes.bool,\n disabled: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onFavoriteClick: PropTypes.func,\n 'aria-label': PropTypes.shape({\n favorite: PropTypes.string,\n addToFavorite: PropTypes.string,\n removeFromFavorite: PropTypes.string\n })\n};\n\nFavorite.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default Favorite;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAO,OAAO;AACnE,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAAQC,EAAE,IAAIC,MAAM,QAAO,MAAM;AAEjC,SACEC,6BAA6B,IAAIC,QAAQ,EACzCC,gCAAgC,IAAIC,SAAS,QACxC,0BAA0B;AACjC,OAAOC,QAAQ,IAAGC,kBAAkB,EAAEC,uBAAuB,QAAO,qBAAqB;AACzF,OAAOC,OAAO,IAAGC,qBAAqB,QAAO,oBAAoB;AACjE,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,KAAK,MAAM,gBAAgB;AAElC,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AAQ,EAAE,CAAE;IACZC,YAAY;IACZC,UAAU,EAAE;EAAM,GAEjBlB,IACK,CAAC,eACT/D,KAAA,CAAAgE,aAAA,CAAChD,OAAO;IACNkE,QAAQ,EAAE,EAAG;IACbC,QAAQ,EAAExC,sBAAuB;IACjCM,gBAAgB,EAAEA,gBAAiB;IACnCmC,cAAc,EAAEtC,cAAe;IAC/BuC,oCAAoC,EAAEtD,SAAS,CAAC,2BAA2B,CAAE;IAC7EuD,0BAA0B;EAAA,CAC3B,CACE,CAAC;AAEV,CAAC;AAEDlE,QAAQ,CAACmE,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACnBlE,SAAS,EAAEnB,SAAS,CAACsF,MAAM;EAC3BtE,QAAQ,EAAEhB,SAAS,CAACuF,IAAI;EACxBhE,QAAQ,EAAEvB,SAAS,CAACuF,IAAI;EACxBtE,kBAAkB,EAAEjB,SAAS,CAACsF,MAAM;EACpCpE,qBAAqB,EAAElB,SAAS,CAACsF,MAAM;EACvCjE,eAAe,EAAErB,SAAS,CAACwF,IAAI;EAC/B,YAAY,EAAExF,SAAS,CAACyF,KAAK,CAAC;IAC5BzE,QAAQ,EAAEhB,SAAS,CAACsF,MAAM;IAC1BpB,aAAa,EAAElE,SAAS,CAACsF,MAAM;IAC/BtB,kBAAkB,EAAEhE,SAAS,CAACsF;EAChC,CAAC;AACH,CAAC;AAEDvE,QAAQ,CAAC2E,YAAY,GAAG;EACtBjE,IAAI,EAAEjB,QAAQ,CAACmF,iBAAiB,CAAClE,IAAI;EACrCC,SAAS,EAAElB,QAAQ,CAACmF,iBAAiB,CAACjE;AACxC,CAAC;AAED,eAAeX,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"favorite.js","names":["React","useCallback","useMemo","useRef","useState","PropTypes","classnames","v5","uuidV5","NovaCompositionNavigationMore","MoreIcon","NovaCompositionCoorpacademyCheck","CheckIcon","Provider","GetSkinFromContext","GetTranslateFromContext","ToolTip","toggleStateOnKeyPress","Button","style","Favorite","favorite","addFavoriteToolTip","removeFavoriteToolTip","className","ariaLabel","onFavoriteClick","_noop","disabled","legacyContext","skin","translate","handleFavoriteClick","e","stopPropagation","preventDefault","primaryColor","_get","darkColor","brandColor","buttonRef","allowToolTip","_isEmpty","console","log","favoriteButtonAnchorId","URL","undefined","toolTipContent","mouseLeaveTimer","setMouseLeaveTimer","toolTipIsVisible","setToolTipIsVisible","handleMouseOver","clearTimeout","_has","current","focus","handleMouseLeave","setTimeout","blur","handleKeyPress","event","iconWrapperClassName","selected","icon","createElement","checkIcon","color","width","height","removeFromFavorite","moreIcon","addToFavorite","favoriteWrapper","type","buttonContentClassName","onClick","onKeyDown","onMouseLeave","onMouseOver","tabIndex","useButtonTag","useWrapper","fontSize","anchorId","TooltipContent","closeToolTipInformationTextAriaLabel","stickyOnKeyboardNavigation","propTypes","process","env","NODE_ENV","string","bool","func","shape","contextTypes","childContextTypes"],"sources":["../../../src/molecule/card/favorite.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {v5 as uuidV5} from 'uuid';\nimport {get, has, isEmpty, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Button from '../../atom/button';\nimport style from './favorite.css';\n\nconst Favorite = (\n {\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n className,\n 'aria-label': ariaLabel = {},\n onFavoriteClick = noop,\n disabled\n },\n legacyContext\n) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const handleFavoriteClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n if (!disabled) onFavoriteClick(e);\n },\n [disabled, onFavoriteClick]\n );\n\n const primaryColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const brandColor = get('common.brand', skin);\n\n const buttonRef = useRef(null);\n\n const allowToolTip = useMemo(\n () => !isEmpty(removeFavoriteToolTip) && !isEmpty(addFavoriteToolTip),\n [addFavoriteToolTip, removeFavoriteToolTip]\n );\n\n // eslint-disable-next-line no-console\n console.log('🚀 ~ favorite.js:49 ~ allowToolTip:', allowToolTip);\n\n // to be replaced by useId when React17 is bumped to React18\n const [favoriteButtonAnchorId] = useState(\n allowToolTip ? uuidV5('engaged-battle-', uuidV5.URL) : undefined\n );\n\n const toolTipContent = useMemo(\n // eslint-disable-next-line no-nested-ternary\n () => (allowToolTip ? (favorite ? removeFavoriteToolTip : addFavoriteToolTip) : null),\n [addFavoriteToolTip, favorite, removeFavoriteToolTip, allowToolTip]\n );\n // eslint-disable-next-line no-console\n console.log('🚀 ~ favorite.js:63 ~ toolTipContent:', toolTipContent);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n /* istanbul ignore next */ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(\n setTimeout(() => {\n setToolTipIsVisible(false);\n // @ts-expect-error (error: blur does not exists on type never)\n /* istanbul ignore next */ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();\n }, 500)\n );\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const iconWrapperClassName = useMemo(\n () => classnames(style.favorite, className, favorite && style.selected),\n [className, favorite]\n );\n const icon = useMemo(\n () =>\n favorite ? (\n <CheckIcon\n // eslint-disable-next-line css-modules/no-undef-class\n className={style.checkIcon}\n style={{color: brandColor}}\n width={13}\n height={13}\n data-testid=\"favorite-check-icon\"\n aria-label={ariaLabel.removeFromFavorite}\n />\n ) : (\n <MoreIcon\n className={style.moreIcon}\n style={{color: darkColor}}\n width={13}\n height={13}\n data-testid=\"favorite-add-icon\"\n aria-label={ariaLabel.addToFavorite}\n />\n ),\n [ariaLabel.addToFavorite, ariaLabel.removeFromFavorite, brandColor, darkColor, favorite]\n );\n\n return (\n <div className={style.favoriteWrapper} data-testid=\"favorite-wrapper\">\n <Button\n buttonRef={buttonRef}\n type=\"button\"\n data-for={favoriteButtonAnchorId}\n data-tooltip-place=\"left\"\n data-tip={allowToolTip}\n data-name=\"favorite\"\n data-testid=\"favorite-button\"\n aria-label={ariaLabel.favorite}\n buttonContentClassName={iconWrapperClassName}\n onClick={handleFavoriteClick}\n style={{\n color: primaryColor\n }}\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n tabIndex={0}\n useButtonTag\n useWrapper={false}\n >\n {icon}\n </Button>\n <ToolTip\n fontSize={12}\n anchorId={favoriteButtonAnchorId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={toolTipContent}\n closeToolTipInformationTextAriaLabel={translate('close_tooltip_information')}\n stickyOnKeyboardNavigation\n />\n </div>\n );\n};\n\nFavorite.propTypes = {\n className: PropTypes.string,\n favorite: PropTypes.bool,\n disabled: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onFavoriteClick: PropTypes.func,\n 'aria-label': PropTypes.shape({\n favorite: PropTypes.string,\n addToFavorite: PropTypes.string,\n removeFromFavorite: PropTypes.string\n })\n};\n\nFavorite.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default Favorite;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAE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2F,KAAK,CAAC;IAC5B3E,QAAQ,EAAEhB,SAAS,CAACwF,MAAM;IAC1BpB,aAAa,EAAEpE,SAAS,CAACwF,MAAM;IAC/BtB,kBAAkB,EAAElE,SAAS,CAACwF;EAChC,CAAC;AACH,CAAC;AAEDzE,QAAQ,CAAC6E,YAAY,GAAG;EACtBnE,IAAI,EAAEjB,QAAQ,CAACqF,iBAAiB,CAACpE,IAAI;EACrCC,SAAS,EAAElB,QAAQ,CAACqF,iBAAiB,CAACnE;AACxC,CAAC;AAED,eAAeX,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;AA8QA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;;;AAnKF,uDA+HG"}
|
|
@@ -8,9 +8,11 @@ import React, { useMemo, memo } from 'react';
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import classnames from 'classnames';
|
|
10
10
|
import { NovaCompositionCoorpacademyPadlock as LockIcon, NovaCompositionCoorpacademyPictures as PicturesIcon } from '@coorpacademy/nova-icons';
|
|
11
|
-
import { isExternalContent, EXTERNAL_CONTENT_ICONS } from '../../util/external-content';
|
|
11
|
+
import { isExternalContent, ICONS_TYPES, EXTERNAL_CONTENT_ICONS } from '../../util/external-content';
|
|
12
12
|
import Provider from '../../atom/provider';
|
|
13
13
|
import CardContentInfo, { MODES } from '../card-content';
|
|
14
|
+
import FaIcon from '../../atom/icon';
|
|
15
|
+
import { COLORS } from '../../variables/colors';
|
|
14
16
|
import Customer from './customer';
|
|
15
17
|
import Favorite from './favorite';
|
|
16
18
|
import Selectable from './selectable';
|
|
@@ -20,6 +22,7 @@ export const THEMES = {
|
|
|
20
22
|
default: null,
|
|
21
23
|
coorpmanager: style.coorpmanager
|
|
22
24
|
};
|
|
25
|
+
const ICON_SIZE = '28px';
|
|
23
26
|
const CardBackground = ({
|
|
24
27
|
type,
|
|
25
28
|
image,
|
|
@@ -31,22 +34,35 @@ const CardBackground = ({
|
|
|
31
34
|
const externalContent = isExternalContent(type);
|
|
32
35
|
const primaryColor = _get('common.primary', skin);
|
|
33
36
|
const whiteColor = _get('common.white', skin);
|
|
34
|
-
if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
+
if (externalContent && EXTERNAL_CONTENT_ICONS[type] || type === 'chapter') {
|
|
38
|
+
const {
|
|
39
|
+
iconName,
|
|
40
|
+
iconColor
|
|
41
|
+
} = ICONS_TYPES[type];
|
|
37
42
|
const backgroundIcon = /*#__PURE__*/React.createElement("div", {
|
|
38
|
-
className: style.externalIconCircleWrapper
|
|
39
|
-
}, /*#__PURE__*/React.createElement(
|
|
40
|
-
|
|
43
|
+
className: classnames(style.externalIconCircleWrapper, style.externalIconCircleWithImageWrapper)
|
|
44
|
+
}, /*#__PURE__*/React.createElement(FaIcon, {
|
|
45
|
+
iconName: iconName,
|
|
46
|
+
customStyle: {
|
|
47
|
+
color: COLORS.white,
|
|
48
|
+
height: ICON_SIZE,
|
|
49
|
+
width: ICON_SIZE
|
|
50
|
+
}
|
|
41
51
|
}));
|
|
42
52
|
if (image) {
|
|
43
53
|
const _backgroundIcon = /*#__PURE__*/React.createElement("div", {
|
|
44
54
|
className: classnames(style.externalIconCircleWrapper, style.externalIconCircleWithImageWrapper),
|
|
45
55
|
style: {
|
|
46
56
|
backgroundColor: iconColor
|
|
57
|
+
},
|
|
58
|
+
"data-testid": "card-background-image"
|
|
59
|
+
}, /*#__PURE__*/React.createElement(FaIcon, {
|
|
60
|
+
iconName: iconName,
|
|
61
|
+
customStyle: {
|
|
62
|
+
color: COLORS.white,
|
|
63
|
+
height: ICON_SIZE,
|
|
64
|
+
width: ICON_SIZE
|
|
47
65
|
}
|
|
48
|
-
}, /*#__PURE__*/React.createElement(IconType, {
|
|
49
|
-
className: style.externalIconWithImage
|
|
50
66
|
}));
|
|
51
67
|
return /*#__PURE__*/React.createElement("div", {
|
|
52
68
|
className: style.imageWrapper
|
|
@@ -78,7 +94,7 @@ const CardBackground = ({
|
|
|
78
94
|
}
|
|
79
95
|
}) : null;
|
|
80
96
|
return /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
className:
|
|
97
|
+
className: style.imageWrapper
|
|
82
98
|
}, /*#__PURE__*/React.createElement("div", {
|
|
83
99
|
"data-name": "cover",
|
|
84
100
|
"aria-label": ariaLabel,
|
|
@@ -135,7 +151,7 @@ const Card = /*#__PURE__*/memo(function Card(props, context) {
|
|
|
135
151
|
} = props;
|
|
136
152
|
const empty = _isEmpty(_pick(['title', 'type', 'author', 'image'], props));
|
|
137
153
|
const primaryColor = _get('common.primary', skin);
|
|
138
|
-
const cardStyle = classnames(THEMES[theme],
|
|
154
|
+
const cardStyle = classnames(THEMES[theme], style.course, title ? null : style.lazy, style.grid, empty ? style.empty : null);
|
|
139
155
|
const disabled = hidden && (!isSelected || _isUndefined(isSelected));
|
|
140
156
|
const handleClick = useMemo(() => e => onClick(e), [onClick]);
|
|
141
157
|
const lock = disabled ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -164,6 +180,8 @@ const Card = /*#__PURE__*/memo(function Card(props, context) {
|
|
|
164
180
|
return contentType;
|
|
165
181
|
}
|
|
166
182
|
};
|
|
183
|
+
// eslint-disable-next-line no-console
|
|
184
|
+
console.log('type of card', type, 'favorite', favorite);
|
|
167
185
|
return /*#__PURE__*/React.createElement("div", {
|
|
168
186
|
className: cardStyle,
|
|
169
187
|
"data-name": "card",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","memo","PropTypes","classnames","NovaCompositionCoorpacademyPadlock","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","_get","whiteColor","IconType","icon","iconColor","color","backgroundIcon","createElement","className","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","_isEmpty","_pick","cardStyle","chapter","course","lazy","grid","_isUndefined","handleClick","e","lock","lockContent","lockIcon","height","dangerouslySetInnerHTML","__html","inlineBadgeStyle","getType","contentType","_extends","mode","CARD","lockWrapper","cardPropTypes","shape","number","func","oneOf","_keys"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span\n aria-label={disabledArialabel}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: disabledContent}}\n />\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-a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AAC;EACvD,kBAAkB,EAAElD,SAAS,CAACsD,MAAM;EACpC,qBAAqB,EAAEtD,SAAS,CAACsD,MAAM;EACvC,yBAAyB,EAAE7C,eAAe,CAACyC,SAAS,CAAC,YAAY;AACnE,CAAC;AAEDM,IAAI,CAACN,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGyD,aAAa;AAE9B,eAAetD,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","memo","PropTypes","classnames","NovaCompositionCoorpacademyPadlock","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","ICONS_TYPES","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","FaIcon","COLORS","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","ICON_SIZE","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","_get","whiteColor","iconName","iconColor","backgroundIcon","createElement","className","externalIconCircleWrapper","externalIconCircleWithImageWrapper","customStyle","color","white","height","width","_backgroundIcon","backgroundColor","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","_isEmpty","_pick","cardStyle","course","lazy","grid","_isUndefined","handleClick","e","lock","lockContent","lockIcon","dangerouslySetInnerHTML","__html","inlineBadgeStyle","getType","contentType","console","log","_extends","mode","CARD","lockWrapper","cardPropTypes","shape","number","func","oneOf","_keys"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, ICONS_TYPES, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport FaIcon from '../../atom/icon';\nimport {COLORS} from '../../variables/colors';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst ICON_SIZE = '28px';\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if ((externalContent && EXTERNAL_CONTENT_ICONS[type]) || type === 'chapter') {\n const {iconName, iconColor} = ICONS_TYPES[type];\n const backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n >\n <FaIcon\n iconName={iconName}\n customStyle={{\n color: COLORS.white,\n height: ICON_SIZE,\n width: ICON_SIZE\n }}\n />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n data-testid=\"card-background-image\"\n >\n <FaIcon\n iconName={iconName}\n customStyle={{\n color: COLORS.white,\n height: ICON_SIZE,\n width: ICON_SIZE\n }}\n />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span\n aria-label={disabledArialabel}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: disabledContent}}\n />\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n // eslint-disable-next-line no-console\n console.log('type of card', type, 'favorite', favorite);\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,IAAI,QAAO,OAAO;AAC1C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kCAAkC,IAAIC,QAAQ,EAC9CC,mCAAmC,IAAIC,YAAY,QAC9C,0BAA0B;AACjC,SAAQC,iBAAiB,EAAEC,WAAW,EAAEC,sBAAsB,QAAO,6BAA6B;AAClG,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,eAAe,IAAGC,KAAK,QAAO,iBAAiB;AACtD,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,YAAY,MA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
@@ -5,13 +5,16 @@
|
|
|
5
5
|
@value grey from colors;
|
|
6
6
|
@value dark from colors;
|
|
7
7
|
@value white from colors;
|
|
8
|
+
@value cm_blue_700 from colors;
|
|
9
|
+
@value primary_100 from colors;
|
|
10
|
+
@value cm_grey_75 from colors;
|
|
8
11
|
|
|
9
12
|
.notificationWrapper {
|
|
10
13
|
width: 100%;
|
|
11
14
|
height: 100%;
|
|
12
15
|
top: 0;
|
|
13
16
|
left: 0;
|
|
14
|
-
background:
|
|
17
|
+
background: rgba(29, 29, 43, 0.5);
|
|
15
18
|
position: absolute;
|
|
16
19
|
z-index: 0;
|
|
17
20
|
opacity: 0;
|
|
@@ -19,44 +22,64 @@
|
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
.notification {
|
|
22
|
-
width:
|
|
23
|
-
height: 100px;
|
|
25
|
+
width: 156px;
|
|
24
26
|
background: light;
|
|
25
27
|
position: absolute;
|
|
26
28
|
top: 50%;
|
|
27
29
|
left: 50%;
|
|
28
|
-
|
|
29
|
-
border-radius:
|
|
30
|
-
padding:
|
|
30
|
+
transform: translate(-50%, -50%);
|
|
31
|
+
border-radius: 12px;
|
|
32
|
+
padding: 16px;
|
|
31
33
|
box-sizing: border-box;
|
|
32
34
|
color: grey;
|
|
35
|
+
background: cm_grey_75;
|
|
36
|
+
align-items: center;
|
|
37
|
+
display: flex;
|
|
38
|
+
gap: 12px;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
flex-direction: column;
|
|
33
41
|
}
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
/* pour le dev */
|
|
44
|
+
.showOverlay {
|
|
45
|
+
visibility: visible;
|
|
46
|
+
opacity: 1;
|
|
47
|
+
z-index: 3;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
|
-
.showOverlay {
|
|
40
|
-
animation:
|
|
50
|
+
/* .showOverlay .notification {
|
|
51
|
+
animation: scale 120s ease-in-out forwards;
|
|
41
52
|
}
|
|
42
53
|
|
|
54
|
+
.showOverlay {
|
|
55
|
+
animation: fadeIn 120s ease-in-out forwards;
|
|
56
|
+
} */
|
|
57
|
+
|
|
43
58
|
.notification .icon {
|
|
44
59
|
font-size: 30px;
|
|
45
|
-
height:
|
|
46
|
-
width:
|
|
60
|
+
height: 20px;
|
|
61
|
+
width: 15px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.iconWrapper {
|
|
65
|
+
width: 32px;
|
|
66
|
+
height: 32px;
|
|
67
|
+
padding: 8px;
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
align-items: center;
|
|
71
|
+
border-radius: 12px;
|
|
47
72
|
}
|
|
48
73
|
|
|
49
74
|
.message {
|
|
50
|
-
|
|
51
|
-
height: 50px;
|
|
52
|
-
line-height: 50px;
|
|
75
|
+
line-height: 20px;
|
|
53
76
|
}
|
|
54
77
|
|
|
55
78
|
.message span {
|
|
56
79
|
display: inline-block;
|
|
57
80
|
vertical-align: middle;
|
|
58
81
|
user-select: none;
|
|
59
|
-
line-height:
|
|
82
|
+
line-height: 20px;
|
|
60
83
|
font-size: 14px;
|
|
61
84
|
font-family: 'Gilroy';
|
|
62
85
|
text-align: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/notification.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/notification.js"],"names":[],"mappings":";AA+BA,uDAuBC"}
|