@coorpacademy/components 10.3.32-alpha.16 → 10.3.32-alpha.2
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-switch/test/fixtures.js +0 -10
- package/es/atom/input-switch/test/fixtures.js.map +1 -1
- package/es/atom/loader/test/fixtures.js +0 -2
- package/es/atom/loader/test/fixtures.js.map +1 -1
- package/es/molecule/card/customer.css +3 -61
- package/es/molecule/card/customer.js +5 -17
- package/es/molecule/card/customer.js.map +1 -1
- package/es/molecule/card/index.js +5 -15
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/style.css +24 -86
- package/es/molecule/card/test/fixtures.js +0 -2
- package/es/molecule/card/test/fixtures.js.map +1 -1
- package/es/molecule/card-content/index.js +5 -11
- package/es/molecule/card-content/index.js.map +1 -1
- package/es/molecule/card-content/style.css +0 -52
- package/es/molecule/vertical-tabs/test/fixtures.js +0 -2
- package/es/molecule/vertical-tabs/test/fixtures.js.map +1 -1
- package/es/molecule/wizard-summary/style.css +0 -1
- package/es/organism/course-selection/test/fixtures/default.js +7 -29
- package/es/organism/course-selection/test/fixtures/default.js.map +1 -1
- package/es/organism/course-selection/test/fixtures.js +0 -2
- package/es/organism/course-selection/test/fixtures.js.map +1 -1
- package/es/organism/wizard-contents/style.css +9 -9
- package/lib/atom/input-switch/test/fixtures.js +0 -15
- package/lib/atom/input-switch/test/fixtures.js.map +1 -1
- package/lib/atom/loader/test/fixtures.js +0 -3
- package/lib/atom/loader/test/fixtures.js.map +1 -1
- package/lib/molecule/card/customer.css +3 -61
- package/lib/molecule/card/customer.js +6 -22
- package/lib/molecule/card/customer.js.map +1 -1
- package/lib/molecule/card/index.js +6 -19
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/style.css +24 -86
- package/lib/molecule/card/test/fixtures.js +0 -3
- package/lib/molecule/card/test/fixtures.js.map +1 -1
- package/lib/molecule/card-content/index.js +6 -14
- package/lib/molecule/card-content/index.js.map +1 -1
- package/lib/molecule/card-content/style.css +0 -52
- package/lib/molecule/vertical-tabs/test/fixtures.js +0 -3
- package/lib/molecule/vertical-tabs/test/fixtures.js.map +1 -1
- package/lib/molecule/wizard-summary/style.css +0 -1
- package/lib/organism/course-selection/test/fixtures/default.js +7 -30
- package/lib/organism/course-selection/test/fixtures/default.js.map +1 -1
- package/lib/organism/course-selection/test/fixtures.js +0 -3
- package/lib/organism/course-selection/test/fixtures.js.map +1 -1
- package/lib/organism/wizard-contents/style.css +9 -9
- package/package.json +2 -2
- package/es/molecule/card/test/fixtures/coorpmanager.js +0 -18
- package/es/molecule/card/test/fixtures/coorpmanager.js.map +0 -1
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/card/test/fixtures/coorpmanager.js +0 -28
- package/lib/molecule/card/test/fixtures/coorpmanager.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default =
|
|
5
|
-
|
|
6
|
-
var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
|
|
4
|
+
exports.default = void 0;
|
|
7
5
|
|
|
8
6
|
var _pick2 = _interopRequireDefault(require("lodash/fp/pick"));
|
|
9
7
|
|
|
@@ -45,12 +43,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
45
43
|
|
|
46
44
|
function _extends() { _extends = Object.assign || 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); }
|
|
47
45
|
|
|
48
|
-
const THEMES = {
|
|
49
|
-
default: null,
|
|
50
|
-
coorpmanager: _style.default.coorpmanager
|
|
51
|
-
};
|
|
52
|
-
exports.THEMES = THEMES;
|
|
53
|
-
|
|
54
46
|
const CardBackground = ({
|
|
55
47
|
type,
|
|
56
48
|
image,
|
|
@@ -152,13 +144,12 @@ const Card = (0, _react.memo)(function Card(props, context) {
|
|
|
152
144
|
isSelected,
|
|
153
145
|
notification,
|
|
154
146
|
badgeCategory,
|
|
155
|
-
badgeLabel
|
|
156
|
-
theme = 'default'
|
|
147
|
+
badgeLabel
|
|
157
148
|
} = props;
|
|
158
149
|
const empty = (0, _isEmpty2.default)((0, _pick2.default)(['title', 'type', 'author', 'image'], props));
|
|
159
150
|
const primaryColor = (0, _get2.default)('common.primary', skin);
|
|
160
151
|
const whiteColor = (0, _get2.default)('common.white', skin);
|
|
161
|
-
const cardStyle = (0, _classnames.default)(
|
|
152
|
+
const cardStyle = (0, _classnames.default)(type === 'chapter' ? _style.default.chapter : _style.default.course, title ? null : _style.default.lazy, _style.default.grid, empty ? _style.default.empty : null);
|
|
162
153
|
const handleClick = (0, _react.useMemo)(() => e => !disabled && onClick(e), [disabled, onClick]);
|
|
163
154
|
const lock = disabled ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidLoginLocked, {
|
|
164
155
|
className: _style.default.lockIcon,
|
|
@@ -203,9 +194,7 @@ const Card = (0, _react.memo)(function Card(props, context) {
|
|
|
203
194
|
}) : null, /*#__PURE__*/_react.default.createElement(_selectable.default, {
|
|
204
195
|
isSelected: isSelected
|
|
205
196
|
}), notification ? /*#__PURE__*/_react.default.createElement(_notification.default, notification) : null, customer ? /*#__PURE__*/_react.default.createElement(_customer.default, _extends({}, customer, {
|
|
206
|
-
|
|
207
|
-
type: type,
|
|
208
|
-
disabled: disabled
|
|
197
|
+
className: (0, _classnames.default)(_style.default.customer, type === 'chapter' ? _style.default.chapterCustomer : null)
|
|
209
198
|
})) : null, /*#__PURE__*/_react.default.createElement(_cardContent.default, {
|
|
210
199
|
mode: _cardContent.MODES.CARD,
|
|
211
200
|
adaptiv: adaptiv,
|
|
@@ -217,8 +206,7 @@ const Card = (0, _react.memo)(function Card(props, context) {
|
|
|
217
206
|
title: title,
|
|
218
207
|
type: type,
|
|
219
208
|
badgeCategory: badgeCategory,
|
|
220
|
-
badgeLabel: badgeLabel
|
|
221
|
-
theme: theme
|
|
209
|
+
badgeLabel: badgeLabel
|
|
222
210
|
}), badge ? /*#__PURE__*/_react.default.createElement("div", {
|
|
223
211
|
className: _style.default.badge,
|
|
224
212
|
style: inlineBadgeStyle
|
|
@@ -248,8 +236,7 @@ Card.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
248
236
|
isSelected: _propTypes.default.bool,
|
|
249
237
|
notification: _propTypes.default.shape(_notification.default.propTypes),
|
|
250
238
|
badgeCategory: _cardContent.default.propTypes.badgeCategory,
|
|
251
|
-
badgeLabel: _cardContent.default.propTypes.badgeLabel
|
|
252
|
-
theme: _propTypes.default.oneOf((0, _keys2.default)(THEMES))
|
|
239
|
+
badgeLabel: _cardContent.default.propTypes.badgeLabel
|
|
253
240
|
} : {};
|
|
254
241
|
var _default = Card;
|
|
255
242
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/card/index.js"],"names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","skin","externalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","props","context","badge","adaptiv","disabled","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","shape","Customer","number","func","Notification","CardContentInfo","oneOf"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,MAAM,GAAG;AACpBC,EAAAA,OAAO,EAAE,IADW;AAEpBC,EAAAA,YAAY,EAAEC,eAAMD;AAFA,CAAf;;;AAKP,MAAME,cAAc,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,KAAP;AAAcC,EAAAA;AAAd,CAAD,EAAuB;AAACC,EAAAA;AAAD,CAAvB,KAAkC;AACvD,QAAMC,eAAe,GAAG,wCAAkBJ,IAAlB,CAAxB;AACA,QAAMK,YAAY,GAAG,mBAAI,gBAAJ,EAAsBF,IAAtB,CAArB;AACA,QAAMG,UAAU,GAAG,mBAAI,cAAJ,EAAoBH,IAApB,CAAnB;;AAEA,MAAIC,eAAe,IAAIG,wCAAuBP,IAAvB,CAAvB,EAAqD;AACnD,UAAMQ,QAAQ,GAAGD,wCAAuBP,IAAvB,EAA6BS,IAA9C;AACA,UAAMC,SAAS,GAAGH,wCAAuBP,IAAvB,EAA6BW,KAA/C;;AACA,UAAMC,cAAc,gBAClB;AAAK,MAAA,SAAS,EAAEd,eAAMe;AAAtB,oBACE,6BAAC,QAAD;AAAU,MAAA,SAAS,EAAEf,eAAMgB;AAA3B,MADF,CADF;;AAMA,QAAIb,KAAJ,EAAW;AACT,YAAMc,eAAe,gBACnB;AACE,QAAA,SAAS,EAAE,yBACTjB,eAAMe,yBADG,EAETf,eAAMkB,kCAFG,CADb;AAKE,QAAA,KAAK,EAAE;AACLC,UAAAA,eAAe,EAAEP;AADZ;AALT,sBASE,6BAAC,QAAD;AAAU,QAA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fK,EAAAA,OAAO,EAAEP,mBAAUE,IAJJ;AAKf/B,EAAAA,IAAI,EAAE6B,mBAAUC,MALD;AAMfQ,EAAAA,KAAK,EAAET,mBAAUC,MANF;AAOfS,EAAAA,MAAM,EAAEV,mBAAUC,MAPH;AAQfW,EAAAA,eAAe,EAAEZ,mBAAUE,IARZ;AASfS,EAAAA,QAAQ,EAAEX,mBAAUuC,KAAV,CAAgBC,kBAASzC,SAAzB,CATK;AAUfc,EAAAA,QAAQ,EAAEb,mBAAUyC,MAVL;AAWf3B,EAAAA,QAAQ,EAAEd,mBAAUE,IAXL;AAYfa,EAAAA,kBAAkB,EAAEf,mBAAUC,MAZf;AAafe,EAAAA,qBAAqB,EAAEhB,mBAAUC,MAblB;AAcfgB,EAAAA,OAAO,EAAEjB,mBAAU0C,IAdJ;AAefxB,EAAAA,eAAe,EAAElB,mBAAU0C,IAfZ;AAgBfvB,EAAAA,UAAU,EAAEnB,mBAAUE,IAhBP;AAiBfkB,EAAAA,YAAY,EAAEpB,mBAAUuC,KAAV,CAAgBI,sBAAa5C,SAA7B,CAjBC;AAkBfsB,EAAAA,aAAa,EAAEuB,qBAAgB7C,SAAhB,CAA0BsB,aAlB1B;AAmBfC,EAAAA,UAAU,EAAEsB,qBAAgB7C,SAAhB,CAA0BuB,UAnBvB;AAoBfC,EAAAA,KAAK,EAAEvB,mBAAU6C,KAAV,CAAgB,oBAAK/E,MAAL,CAAhB;AApBQ,CAAjB;eAsBeqC,I","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 NovaSolidLoginLocked 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}, {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 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 style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : 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 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};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled = 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 } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', 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 handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\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 >\n <CardBackground type={type} image={image} empty={empty} />\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 />\n ) : null}\n <Selectable isSelected={isSelected} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? <Customer {...customer} theme={theme} type={type} disabled={disabled} /> : 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 />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle}>\n {badge}\n </div>\n ) : null}\n {disabled ? <div className={style.lockWrapper}>{lock}</div> : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\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};\nexport default Card;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/card/index.js"],"names":["CardBackground","type","image","empty","skin","externalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","style","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","props","context","badge","adaptiv","disabled","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","chapterCustomer","MODES","CARD","lockWrapper","shape","Customer","number","func","Notification","CardContentInfo"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG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AU0C,IAfZ;AAgBfvB,EAAAA,UAAU,EAAEnB,mBAAUE,IAhBP;AAiBfkB,EAAAA,YAAY,EAAEpB,mBAAUuC,KAAV,CAAgBI,sBAAa5C,SAA7B,CAjBC;AAkBfsB,EAAAA,aAAa,EAAEuB,qBAAgB7C,SAAhB,CAA0BsB,aAlB1B;AAmBfC,EAAAA,UAAU,EAAEsB,qBAAgB7C,SAAhB,CAA0BuB;AAnBvB,CAAjB;eAqBenB,I","sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked 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\nconst CardBackground = ({type, image, empty}, {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 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 style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : 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 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};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled = 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 } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\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 >\n <CardBackground type={type} image={image} empty={empty} />\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 />\n ) : null}\n <Selectable isSelected={isSelected} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n className={classnames(style.customer, type === 'chapter' ? style.chapterCustomer : null)}\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 />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle}>\n {badge}\n </div>\n ) : null}\n {disabled ? <div className={style.lockWrapper}>{lock}</div> : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\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};\nexport default Card;\n"],"file":"index.js"}
|
|
@@ -36,6 +36,25 @@
|
|
|
36
36
|
z-index: 0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.customer {
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 0;
|
|
42
|
+
left: 0;
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.customer {
|
|
48
|
+
background: linear-gradient(
|
|
49
|
+
to bottom,
|
|
50
|
+
rgba(0, 0, 0, 0.2) 0%,
|
|
51
|
+
rgba(0, 0, 0, 0) 20%
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
.chapterCustomer {
|
|
55
|
+
padding-top: 10px;
|
|
56
|
+
}
|
|
57
|
+
|
|
39
58
|
.grid.empty {
|
|
40
59
|
padding-bottom: 25px;
|
|
41
60
|
opacity: 0.6;
|
|
@@ -47,7 +66,6 @@
|
|
|
47
66
|
width: 256px;
|
|
48
67
|
height: 297px;
|
|
49
68
|
}
|
|
50
|
-
|
|
51
69
|
.chapter {
|
|
52
70
|
composes: default;
|
|
53
71
|
border-radius: 8px;
|
|
@@ -55,18 +73,6 @@
|
|
|
55
73
|
height: 297px;
|
|
56
74
|
}
|
|
57
75
|
|
|
58
|
-
.coorpmanager.course {
|
|
59
|
-
border-radius: 5px;
|
|
60
|
-
width: 172px;
|
|
61
|
-
height: 201px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.coorpmanager.chapter {
|
|
65
|
-
border-radius: 5px;
|
|
66
|
-
width: 138px;
|
|
67
|
-
height: 201px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
76
|
.course .imageWrapper {
|
|
71
77
|
width: 100%;
|
|
72
78
|
height: 100%;
|
|
@@ -83,10 +89,6 @@
|
|
|
83
89
|
left: 0;
|
|
84
90
|
}
|
|
85
91
|
|
|
86
|
-
.coorpmanager.chapter .chapterImageWrapper {
|
|
87
|
-
max-height: 52px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
92
|
.default .image {
|
|
91
93
|
overflow: hidden;
|
|
92
94
|
background-position: 50%;
|
|
@@ -216,6 +218,10 @@
|
|
|
216
218
|
left: 0;
|
|
217
219
|
}
|
|
218
220
|
|
|
221
|
+
.default[disabled] .customer {
|
|
222
|
+
background: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
219
225
|
.badge {
|
|
220
226
|
position: absolute;
|
|
221
227
|
width: auto;
|
|
@@ -233,11 +239,6 @@
|
|
|
233
239
|
user-select: none;
|
|
234
240
|
}
|
|
235
241
|
|
|
236
|
-
.coorpmanager .badge {
|
|
237
|
-
padding: 2px 5px;
|
|
238
|
-
font-size: 7px;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
242
|
.emptyIcon {
|
|
242
243
|
vertical-align: middle;
|
|
243
244
|
width: 80px;
|
|
@@ -294,24 +295,11 @@
|
|
|
294
295
|
}
|
|
295
296
|
|
|
296
297
|
.externalIconCircleWrapper {
|
|
297
|
-
border-radius: 50%;
|
|
298
|
-
padding: 17px;
|
|
299
|
-
box-sizing: border-box;
|
|
300
|
-
background-color: rgba(255, 255, 255, 0.3);
|
|
301
|
-
justify-content: center;
|
|
302
|
-
transform: scale(1);
|
|
303
|
-
transition: transform 0.25s ease-in-out;
|
|
304
298
|
width: 80px;
|
|
305
299
|
height: 80px;
|
|
306
300
|
margin-top: 20px;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.coorpmanager .externalIconCircleWrapper {
|
|
310
|
-
width: 50px;
|
|
311
|
-
height: 50px;
|
|
312
|
-
margin-top: 12px;
|
|
313
|
-
padding: 13px;
|
|
314
301
|
border-radius: 50%;
|
|
302
|
+
padding: 17px;
|
|
315
303
|
box-sizing: border-box;
|
|
316
304
|
background-color: rgba(255, 255, 255, 0.3);
|
|
317
305
|
justify-content: center;
|
|
@@ -325,12 +313,6 @@
|
|
|
325
313
|
height: 45px;
|
|
326
314
|
}
|
|
327
315
|
|
|
328
|
-
.coorpmanager .externalIcon {
|
|
329
|
-
color: white;
|
|
330
|
-
width: 23px;
|
|
331
|
-
height: 23px;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
316
|
.externalIconCircleWrapper::after {
|
|
335
317
|
animation: pulse 3s linear 0s infinite;
|
|
336
318
|
animation-play-state: paused;
|
|
@@ -361,18 +343,6 @@
|
|
|
361
343
|
transition: box-shadow 0.25s linear;
|
|
362
344
|
}
|
|
363
345
|
|
|
364
|
-
.coorpmanager .externalIconCircleWrapper::after,
|
|
365
|
-
.coorpmanager .externalIconCircleWrapper::before {
|
|
366
|
-
width: 50px;
|
|
367
|
-
height: 50px;
|
|
368
|
-
top: 0;
|
|
369
|
-
left: 0;
|
|
370
|
-
transform: scale(1);
|
|
371
|
-
opacity: 0;
|
|
372
|
-
box-shadow: inset 0 0 7px 0 rgba(255, 255, 255, 0);
|
|
373
|
-
transition: box-shadow 0.25s linear;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
346
|
.externalIconCircleWithImageWrapper {
|
|
377
347
|
width: 60px;
|
|
378
348
|
height: 60px;
|
|
@@ -380,22 +350,6 @@
|
|
|
380
350
|
z-index: 1;
|
|
381
351
|
}
|
|
382
352
|
|
|
383
|
-
.coorpmanager .externalIconCircleWithImageWrapper {
|
|
384
|
-
width: 50px;
|
|
385
|
-
height: 50px;
|
|
386
|
-
border-radius: 50%;
|
|
387
|
-
padding: 12px;
|
|
388
|
-
z-index: 1;
|
|
389
|
-
margin-top: 20px;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.coorpmanager .externalIconWithImage {
|
|
393
|
-
color: white;
|
|
394
|
-
width: 25px;
|
|
395
|
-
height: 25px;
|
|
396
|
-
padding: 0 0 0 1px;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
353
|
.externalIconWithImage {
|
|
400
354
|
color: white;
|
|
401
355
|
width: 28px;
|
|
@@ -418,22 +372,6 @@
|
|
|
418
372
|
transition: box-shadow 0.25s linear;
|
|
419
373
|
}
|
|
420
374
|
|
|
421
|
-
.coorpmanager .externalIconCircleWithImageWrapper::after,
|
|
422
|
-
.coorpmanager .externalIconCircleWithImageWrapper::before {
|
|
423
|
-
content: '';
|
|
424
|
-
width: 50px;
|
|
425
|
-
height: 50px;
|
|
426
|
-
top: 0;
|
|
427
|
-
left: 0;
|
|
428
|
-
position: absolute;
|
|
429
|
-
transform: scale(1);
|
|
430
|
-
opacity: 0;
|
|
431
|
-
box-shadow: inset 0 0 7px 0 rgba(255, 255, 255, 0);
|
|
432
|
-
transition: box-shadow 0.25s linear;
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
437
375
|
@keyframes pulse {
|
|
438
376
|
0% {
|
|
439
377
|
transform: scale(1);
|
|
@@ -16,8 +16,6 @@ var _arabic = _interopRequireDefault(require("./fixtures/arabic"));
|
|
|
16
16
|
|
|
17
17
|
var _article = _interopRequireDefault(require("./fixtures/article"));
|
|
18
18
|
|
|
19
|
-
var _coorpmanager = _interopRequireDefault(require("./fixtures/coorpmanager"));
|
|
20
|
-
|
|
21
19
|
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
22
20
|
|
|
23
21
|
var _disabled = _interopRequireDefault(require("./fixtures/disabled"));
|
|
@@ -54,7 +52,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
54
52
|
(0, _ava.default)('Molecule › MoleculeCard › Adaptiv › should be rendered', _renderComponent.default, _.default, _adaptiv.default);
|
|
55
53
|
(0, _ava.default)('Molecule › MoleculeCard › Arabic › should be rendered', _renderComponent.default, _.default, _arabic.default);
|
|
56
54
|
(0, _ava.default)('Molecule › MoleculeCard › Article › should be rendered', _renderComponent.default, _.default, _article.default);
|
|
57
|
-
(0, _ava.default)('Molecule › MoleculeCard › Coorpmanager › should be rendered', _renderComponent.default, _.default, _coorpmanager.default);
|
|
58
55
|
(0, _ava.default)('Molecule › MoleculeCard › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
59
56
|
(0, _ava.default)('Molecule › MoleculeCard › Disabled › should be rendered', _renderComponent.default, _.default, _disabled.default);
|
|
60
57
|
(0, _ava.default)('Molecule › MoleculeCard › Empty › should be rendered', _renderComponent.default, _.default, _empty.default);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["t","pass","MoleculeCard","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["t","pass","MoleculeCard","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureSelectableFalse","fixtureSelectableTrue","fixtureVideo"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,uDAAL,EAA8DA,CAAC,IAAI;AACjEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAaC,SAArB,EAAgC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC9CL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,iDAAgDF,GAAI,mEAA7E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,mEAAL,EAA0EG,wBAA1E,EAAgGN,SAAhG,EAA8GO,2BAA9G;AACA,kBAAK,wDAAL,EAA+DD,wBAA/D,EAAqFN,SAArF,EAAmGQ,gBAAnG;AACA,kBAAK,uDAAL,EAA8DF,wBAA9D,EAAoFN,SAApF,EAAkGS,eAAlG;AACA,kBAAK,wDAAL,EAA+DH,wBAA/D,EAAqFN,SAArF,EAAmGU,gBAAnG;AACA,kBAAK,wDAAL,EAA+DJ,wBAA/D,EAAqFN,SAArF,EAAmGW,gBAAnG;AACA,kBAAK,yDAAL,EAAgEL,wBAAhE,EAAsFN,SAAtF,EAAoGY,iBAApG;AACA,kBAAK,sDAAL,EAA6DN,wBAA7D,EAAmFN,SAAnF,EAAiGa,cAAjG;AACA,kBAAK,gEAAL,EAAuEP,wBAAvE,EAA6FN,SAA7F,EAA2Gc,wBAA3G;AACA,kBAAK,yDAAL,EAAgER,wBAAhE,EAAsFN,SAAtF,EAAoGe,iBAApG;AACA,kBAAK,mEAAL,EAA0ET,wBAA1E,EAAgGN,SAAhG,EAA8GgB,2BAA9G;AACA,kBAAK,wDAAL,EAA+DV,wBAA/D,EAAqFN,SAArF,EAAmGiB,gBAAnG;AACA,kBAAK,wDAAL,EAA+DX,wBAA/D,EAAqFN,SAArF,EAAmGkB,gBAAnG;AACA,kBAAK,sDAAL,EAA6DZ,wBAA7D,EAAmFN,SAAnF,EAAiGmB,cAAjG;AACA,kBAAK,gEAAL,EAAuEb,wBAAvE,EAA6FN,SAA7F,EAA2GoB,wBAA3G;AACA,kBAAK,+DAAL,EAAsEd,wBAAtE,EAA4FN,SAA5F,EAA0GqB,uBAA1G;AACA,kBAAK,sDAAL,EAA6Df,wBAA7D,EAAmFN,SAAnF,EAAiGsB,cAAjG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCard from '..';\nimport fixtureAdaptivAndDisabled from './fixtures/adaptiv-and-disabled';\nimport fixtureAdaptiv from './fixtures/adaptiv';\nimport fixtureArabic from './fixtures/arabic';\nimport fixtureArticle from './fixtures/article';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureExternalContent from './fixtures/external-content';\nimport fixtureFavorite from './fixtures/favorite';\nimport fixtureFreerunAndDisabled from './fixtures/freerun-and-disabled';\nimport fixtureFreerun from './fixtures/freerun';\nimport fixturePodcast from './fixtures/podcast';\nimport fixtureScorm from './fixtures/scorm';\nimport fixtureSelectableFalse from './fixtures/selectable-false';\nimport fixtureSelectableTrue from './fixtures/selectable-true';\nimport fixtureVideo from './fixtures/video';\n\ntest('Molecule › MoleculeCard > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCard.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCard.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCard › AdaptivAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptivAndDisabled);\ntest('Molecule › MoleculeCard › Adaptiv › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptiv);\ntest('Molecule › MoleculeCard › Arabic › should be rendered', renderComponentMacro, MoleculeCard, fixtureArabic);\ntest('Molecule › MoleculeCard › Article › should be rendered', renderComponentMacro, MoleculeCard, fixtureArticle);\ntest('Molecule › MoleculeCard › Default › should be rendered', renderComponentMacro, MoleculeCard, fixtureDefault);\ntest('Molecule › MoleculeCard › Disabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureDisabled);\ntest('Molecule › MoleculeCard › Empty › should be rendered', renderComponentMacro, MoleculeCard, fixtureEmpty);\ntest('Molecule › MoleculeCard › ExternalContent › should be rendered', renderComponentMacro, MoleculeCard, fixtureExternalContent);\ntest('Molecule › MoleculeCard › Favorite › should be rendered', renderComponentMacro, MoleculeCard, fixtureFavorite);\ntest('Molecule › MoleculeCard › FreerunAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerunAndDisabled);\ntest('Molecule › MoleculeCard › Freerun › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerun);\ntest('Molecule › MoleculeCard › Podcast › should be rendered', renderComponentMacro, MoleculeCard, fixturePodcast);\ntest('Molecule › MoleculeCard › Scorm › should be rendered', renderComponentMacro, MoleculeCard, fixtureScorm);\ntest('Molecule › MoleculeCard › SelectableFalse › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableFalse);\ntest('Molecule › MoleculeCard › SelectableTrue › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableTrue);\ntest('Molecule › MoleculeCard › Video › should be rendered', renderComponentMacro, MoleculeCard, fixtureVideo);\n"],"file":"fixtures.js"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.
|
|
5
|
-
|
|
6
|
-
var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
|
|
4
|
+
exports.default = exports.MODES = void 0;
|
|
7
5
|
|
|
8
6
|
var _isNil2 = _interopRequireDefault(require("lodash/fp/isNil"));
|
|
9
7
|
|
|
@@ -32,11 +30,6 @@ const MODES = {
|
|
|
32
30
|
CARD: 'card'
|
|
33
31
|
};
|
|
34
32
|
exports.MODES = MODES;
|
|
35
|
-
const THEMES = {
|
|
36
|
-
default: null,
|
|
37
|
-
coorpmanager: _style2.default.coorpmanager
|
|
38
|
-
};
|
|
39
|
-
exports.THEMES = THEMES;
|
|
40
33
|
|
|
41
34
|
const ContentTypeInfo = ({
|
|
42
35
|
mode,
|
|
@@ -55,7 +48,8 @@ const ContentTypeInfo = ({
|
|
|
55
48
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
56
49
|
className: _style2.default.microLearningIcon
|
|
57
50
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyTimer, {
|
|
58
|
-
|
|
51
|
+
height: 40,
|
|
52
|
+
width: 40
|
|
59
53
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
60
54
|
className: _style2.default.microLearninglabel
|
|
61
55
|
}, "5' learning"));
|
|
@@ -141,8 +135,7 @@ const ContentInfo = ({
|
|
|
141
135
|
title,
|
|
142
136
|
type,
|
|
143
137
|
badgeCategory,
|
|
144
|
-
badgeLabel
|
|
145
|
-
theme = 'default'
|
|
138
|
+
badgeLabel
|
|
146
139
|
}) => {
|
|
147
140
|
const progressBarColor = '#3EC483';
|
|
148
141
|
const inlineProgressValueStyle = {
|
|
@@ -166,7 +159,7 @@ const ContentInfo = ({
|
|
|
166
159
|
})) : null;
|
|
167
160
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
168
161
|
"data-name": "info",
|
|
169
|
-
className: (0, _classnames.default)(
|
|
162
|
+
className: (0, _classnames.default)(_style2.default.infoWrapper, mode === MODES.HERO ? _style2.default.hero : _style2.default.card, disabled ? _style2.default.progressBarDisabled : null, externalContent ? _style2.default.externalContent : null)
|
|
170
163
|
}, /*#__PURE__*/_react.default.createElement(ContentTypeInfo, {
|
|
171
164
|
mode: mode,
|
|
172
165
|
type: type,
|
|
@@ -204,8 +197,7 @@ ContentInfo.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
204
197
|
type: _propTypes.default.string,
|
|
205
198
|
mode: _propTypes.default.string,
|
|
206
199
|
badgeCategory: _contentBadge.default.propTypes.category,
|
|
207
|
-
badgeLabel: _contentBadge.default.propTypes.label
|
|
208
|
-
theme: _propTypes.default.oneOf((0, _keys2.default)(THEMES))
|
|
200
|
+
badgeLabel: _contentBadge.default.propTypes.label
|
|
209
201
|
} : {};
|
|
210
202
|
var _default = ContentInfo;
|
|
211
203
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/card-content/index.js"],"names":["MODES","HERO","CARD","THEMES","default","coorpmanager","style","ContentTypeInfo","mode","type","externalContent","context","translate","microLearningIcon","timerIcon","microLearninglabel","EXTERNAL_CONTENT_ICONS","textColor","color","contentTypeInfo","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","bool","string","CardTitle","title","empty","courseContent","innerHTML","lightTitle","darkTitle","__html","AuthorName","author","certifiedAuthor","checkIcon","authorIcon","iconShadow","darkAuthorTitle","ContentInfo","adaptiv","disabled","progress","badgeCategory","badgeLabel","theme","progressBarColor","inlineProgressValueStyle","backgroundColor","width","chapterContent","progressBar","progressWrapper","hideProgressBar","adaptiveIcon","infoWrapper","hero","card","progressBarDisabled","cardInfo","microLearningCardInfo","iconWrapper","number","ContentBadge","category","label","oneOf"],"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,SAAb,CAAuB6C,KAXb;AAYtBpB,EAAAA,KAAK,EAAExB,mBAAU6C,KAAV,CAAgB,oBAAKnE,MAAL,CAAhB;AAZe,CAAxB;eAeewC,W","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyAdaptive as AdaptivIcon,\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport ContentBadge from '../../atom/content-badge';\nimport {innerHTML} from '../../atom/label/style.css';\nimport style from './style.css';\n\nexport const MODES = {\n HERO: 'hero',\n CARD: 'card'\n};\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst ContentTypeInfo = ({mode, type, externalContent}, context) => {\n const {translate} = context;\n if (mode !== MODES.CARD) {\n return null;\n }\n\n if (type === 'chapter') {\n return (\n <div className={style.microLearningIcon}>\n <TimerIcon className={style.timerIcon} />\n <span className={style.microLearninglabel}>{\"5' learning\"}</span>\n </div>\n );\n }\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const textColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n return (\n <div className={style.contentTypeInfo} style={{color: textColor}}>\n {type === 'scorm' ? translate('external_content_scorm') : ''}\n {type === 'video' ? translate('external_content_video') : ''}\n {type === 'article' ? translate('external_content_article') : ''}\n {type === 'podcast' ? translate('external_content_podcast') : ''}\n </div>\n );\n }\n\n return null;\n};\n\nContentTypeInfo.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContentTypeInfo.propTypes = {\n externalContent: PropTypes.bool,\n type: PropTypes.string,\n mode: PropTypes.string\n};\n\nconst CardTitle = ({title, empty, courseContent}) => {\n return (\n <div\n className={classnames(\n style.title,\n innerHTML,\n courseContent ? style.lightTitle : style.darkTitle,\n empty ? style.empty : null\n )}\n data-name=\"title\"\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n};\n\nCardTitle.propTypes = {\n title: PropTypes.string,\n empty: PropTypes.bool,\n courseContent: PropTypes.bool\n};\n\nconst AuthorName = ({author, empty, courseContent, certifiedAuthor}) => {\n const checkIcon = certifiedAuthor ? (\n <CheckIcon\n className={classnames(style.authorIcon, courseContent ? style.iconShadow : null)}\n color=\"inherit\"\n />\n ) : null;\n\n return (\n <div\n data-name=\"author\"\n title={author}\n className={classnames(\n style.author,\n courseContent ? style.lightTitle : style.darkAuthorTitle,\n empty ? style.empty : null\n )}\n >\n <span>{author}</span>\n {checkIcon}\n </div>\n );\n};\n\nAuthorName.propTypes = {\n author: PropTypes.string,\n empty: PropTypes.bool,\n courseContent: PropTypes.bool,\n certifiedAuthor: PropTypes.bool\n};\n\nconst ContentInfo = ({\n adaptiv,\n author,\n certifiedAuthor = false,\n disabled = false,\n empty = false,\n mode = MODES.CARD,\n progress,\n title,\n type,\n badgeCategory,\n badgeLabel,\n theme = 'default'\n}) => {\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${progress * 100}%`\n };\n const externalContent = isExternalContent(type);\n const courseContent = type === 'course';\n const chapterContent = type === 'chapter';\n\n const progressBar =\n mode === MODES.HERO || (!empty && !disabled) ? (\n <div className={!isNil(progress) ? style.progressWrapper : style.hideProgressBar}>\n {!disabled ? (\n <div data-name=\"progress\" className={style.progress} style={inlineProgressValueStyle} />\n ) : null}\n </div>\n ) : null;\n\n const adaptiveIcon = adaptiv ? (\n <div className={classnames(style.adaptiveIcon, courseContent ? style.iconShadow : null)}>\n <AdaptivIcon height={25} />\n </div>\n ) : null;\n\n return (\n <div\n data-name=\"info\"\n className={classnames(\n THEMES[theme],\n style.infoWrapper,\n mode === MODES.HERO ? style.hero : style.card,\n disabled ? style.progressBarDisabled : null,\n externalContent ? style.externalContent : null\n )}\n >\n <ContentTypeInfo mode={mode} type={type} externalContent={externalContent} />\n <div\n className={classnames(style.cardInfo, chapterContent ? style.microLearningCardInfo : null)}\n >\n <div className={style.iconWrapper}>\n {adaptiveIcon}\n {!empty && badgeLabel && badgeCategory && courseContent ? (\n <ContentBadge category={badgeCategory} label={badgeLabel} />\n ) : null}\n </div>\n <CardTitle title={title} empty={empty} courseContent={courseContent} />\n <AuthorName\n author={author}\n empty={empty}\n courseContent={courseContent}\n certifiedAuthor={certifiedAuthor}\n />\n </div>\n {progressBar}\n </div>\n );\n};\n\nContentInfo.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentInfo.propTypes = {\n adaptiv: PropTypes.bool,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n disabled: PropTypes.bool,\n empty: PropTypes.bool,\n progress: PropTypes.number,\n title: PropTypes.string,\n type: PropTypes.string,\n mode: PropTypes.string,\n badgeCategory: ContentBadge.propTypes.category,\n badgeLabel: ContentBadge.propTypes.label,\n theme: PropTypes.oneOf(keys(THEMES))\n};\n\nexport default ContentInfo;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/card-content/index.js"],"names":["MODES","HERO","CARD","ContentTypeInfo","mode","type","externalContent","context","translate","style","microLearningIcon","microLearninglabel","EXTERNAL_CONTENT_ICONS","textColor","color","contentTypeInfo","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","bool","string","CardTitle","title","empty","courseContent","innerHTML","lightTitle","darkTitle","__html","AuthorName","author","certifiedAuthor","checkIcon","authorIcon","iconShadow","darkAuthorTitle","ContentInfo","adaptiv","disabled","progress","badgeCategory","badgeLabel","progressBarColor","inlineProgressValueStyle","backgroundColor","width","chapterContent","progressBar","progressWrapper","hideProgressBar","adaptiveIcon","infoWrapper","hero","card","progressBarDisabled","cardInfo","microLearningCardInfo","iconWrapper","number","ContentBadge","category","label"],"mappings":";;;;;;;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AAC,qBAAD;AAAc,IAAA,QAAQ,EAAEgB,aAAxB;AAAuC,IAAA,KAAK,EAAEC;AAA9C,IADD,GAEG,IAJN,CAHF,eASE,6BAAC,SAAD;AAAW,IAAA,KAAK,EAAEnB,KAAlB;AAAyB,IAAA,KAAK,EAAEC,KAAhC;AAAuC,IAAA,aAAa,EAAEC;AAAtD,IATF,eAUE,6BAAC,UAAD;AACE,IAAA,MAAM,EAAEM,MADV;AAEE,IAAA,KAAK,EAAEP,KAFT;AAGE,IAAA,aAAa,EAAEC,aAHjB;AAIE,IAAA,eAAe,EAAEO;AAJnB,IAVF,CAVF,EA2BGgB,WA3BH,CADF;AA+BD,CApED;;AAsEAX,WAAW,CAACvB,YAAZ,GAA2B;AACzBC,EAAAA,IAAI,EAAEC,kBAASC,iBAAT,CAA2BF;AADR,CAA3B;AAIAsB,WAAW,CAACnB,SAAZ,2CAAwB;AACtBoB,EAAAA,OAAO,EAAEnB,mBAAUC,IADG;AAEtBW,EAAAA,MAAM,EAAEZ,mBAAUE,MAFI;AAGtBW,EAAAA,eAAe,EAAEb,mBAAUC,IAHL;AAItBmB,EAAAA,QAAQ,EAAEpB,mBAAUC,IAJE;AAKtBI,EAAAA,KAAK,EAAEL,mBAAUC,IALK;AAMtBoB,EAAAA,QAAQ,EAAErB,mBAAUwC,MANE;AAOtBpC,EAAAA,KAAK,EAAEJ,mBAAUE,MAPK;AAQtBlB,EAAAA,IAAI,EAAEgB,mBAAUE,MARM;AAStBnB,EAAAA,IAAI,EAAEiB,mBAAUE,MATM;AAUtBoB,EAAAA,aAAa,EAAEmB,sBAAa1C,SAAb,CAAuB2C,QAVhB;AAWtBnB,EAAAA,UAAU,EAAEkB,sBAAa1C,SAAb,CAAuB4C;AAXb,CAAxB;eAcezB,W","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyAdaptive as AdaptivIcon,\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport ContentBadge from '../../atom/content-badge';\nimport {innerHTML} from '../../atom/label/style.css';\nimport style from './style.css';\n\nexport const MODES = {\n HERO: 'hero',\n CARD: 'card'\n};\n\nconst ContentTypeInfo = ({mode, type, externalContent}, context) => {\n const {translate} = context;\n if (mode !== MODES.CARD) {\n return null;\n }\n\n if (type === 'chapter') {\n return (\n <div className={style.microLearningIcon}>\n <TimerIcon height={40} width={40} />\n <span className={style.microLearninglabel}>{\"5' learning\"}</span>\n </div>\n );\n }\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const textColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n return (\n <div className={style.contentTypeInfo} style={{color: textColor}}>\n {type === 'scorm' ? translate('external_content_scorm') : ''}\n {type === 'video' ? translate('external_content_video') : ''}\n {type === 'article' ? translate('external_content_article') : ''}\n {type === 'podcast' ? translate('external_content_podcast') : ''}\n </div>\n );\n }\n\n return null;\n};\n\nContentTypeInfo.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContentTypeInfo.propTypes = {\n externalContent: PropTypes.bool,\n type: PropTypes.string,\n mode: PropTypes.string\n};\n\nconst CardTitle = ({title, empty, courseContent}) => {\n return (\n <div\n className={classnames(\n style.title,\n innerHTML,\n courseContent ? style.lightTitle : style.darkTitle,\n empty ? style.empty : null\n )}\n data-name=\"title\"\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n );\n};\n\nCardTitle.propTypes = {\n title: PropTypes.string,\n empty: PropTypes.bool,\n courseContent: PropTypes.bool\n};\n\nconst AuthorName = ({author, empty, courseContent, certifiedAuthor}) => {\n const checkIcon = certifiedAuthor ? (\n <CheckIcon\n className={classnames(style.authorIcon, courseContent ? style.iconShadow : null)}\n color=\"inherit\"\n />\n ) : null;\n\n return (\n <div\n data-name=\"author\"\n title={author}\n className={classnames(\n style.author,\n courseContent ? style.lightTitle : style.darkAuthorTitle,\n empty ? style.empty : null\n )}\n >\n <span>{author}</span>\n {checkIcon}\n </div>\n );\n};\n\nAuthorName.propTypes = {\n author: PropTypes.string,\n empty: PropTypes.bool,\n courseContent: PropTypes.bool,\n certifiedAuthor: PropTypes.bool\n};\n\nconst ContentInfo = ({\n adaptiv,\n author,\n certifiedAuthor = false,\n disabled = false,\n empty = false,\n mode = MODES.CARD,\n progress,\n title,\n type,\n badgeCategory,\n badgeLabel\n}) => {\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${progress * 100}%`\n };\n const externalContent = isExternalContent(type);\n const courseContent = type === 'course';\n const chapterContent = type === 'chapter';\n\n const progressBar =\n mode === MODES.HERO || (!empty && !disabled) ? (\n <div className={!isNil(progress) ? style.progressWrapper : style.hideProgressBar}>\n {!disabled ? (\n <div data-name=\"progress\" className={style.progress} style={inlineProgressValueStyle} />\n ) : null}\n </div>\n ) : null;\n\n const adaptiveIcon = adaptiv ? (\n <div className={classnames(style.adaptiveIcon, courseContent ? style.iconShadow : null)}>\n <AdaptivIcon height={25} />\n </div>\n ) : null;\n\n return (\n <div\n data-name=\"info\"\n className={classnames(\n style.infoWrapper,\n mode === MODES.HERO ? style.hero : style.card,\n disabled ? style.progressBarDisabled : null,\n externalContent ? style.externalContent : null\n )}\n >\n <ContentTypeInfo mode={mode} type={type} externalContent={externalContent} />\n <div\n className={classnames(style.cardInfo, chapterContent ? style.microLearningCardInfo : null)}\n >\n <div className={style.iconWrapper}>\n {adaptiveIcon}\n {!empty && badgeLabel && badgeCategory && courseContent ? (\n <ContentBadge category={badgeCategory} label={badgeLabel} />\n ) : null}\n </div>\n <CardTitle title={title} empty={empty} courseContent={courseContent} />\n <AuthorName\n author={author}\n empty={empty}\n courseContent={courseContent}\n certifiedAuthor={certifiedAuthor}\n />\n </div>\n {progressBar}\n </div>\n );\n};\n\nContentInfo.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentInfo.propTypes = {\n adaptiv: PropTypes.bool,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n disabled: PropTypes.bool,\n empty: PropTypes.bool,\n progress: PropTypes.number,\n title: PropTypes.string,\n type: PropTypes.string,\n mode: PropTypes.string,\n badgeCategory: ContentBadge.propTypes.category,\n badgeLabel: ContentBadge.propTypes.label\n};\n\nexport default ContentInfo;\n"],"file":"index.js"}
|
|
@@ -21,23 +21,6 @@
|
|
|
21
21
|
margin-top: 53px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.coorpmanager .microLearningIcon {
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
align-self: center;
|
|
28
|
-
margin-top: 35px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.timerIcon {
|
|
32
|
-
height: 40px;
|
|
33
|
-
width: 40px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.coorpmanager .timerIcon {
|
|
37
|
-
height: 30px;
|
|
38
|
-
width: 30px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
24
|
.microLearningIcon svg {
|
|
42
25
|
background:white;
|
|
43
26
|
border-radius: 50%;
|
|
@@ -55,10 +38,6 @@
|
|
|
55
38
|
text-transform: uppercase;
|
|
56
39
|
}
|
|
57
40
|
|
|
58
|
-
.coorpmanager .microLearninglabel {
|
|
59
|
-
font-size: 6px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
41
|
.infoWrapper {
|
|
63
42
|
display: flex;
|
|
64
43
|
flex-direction: column;
|
|
@@ -79,11 +58,6 @@
|
|
|
79
58
|
user-select: none;
|
|
80
59
|
}
|
|
81
60
|
|
|
82
|
-
.coorpmanager .title {
|
|
83
|
-
font-size: 12px;
|
|
84
|
-
font-weight: bold;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
61
|
.lightTitle {
|
|
88
62
|
color: white;
|
|
89
63
|
text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.5);
|
|
@@ -111,10 +85,6 @@
|
|
|
111
85
|
user-select: none;
|
|
112
86
|
}
|
|
113
87
|
|
|
114
|
-
.coorpmanager .author {
|
|
115
|
-
font-size: 8px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
88
|
.hero .title {
|
|
119
89
|
text-align: center;
|
|
120
90
|
color: white;
|
|
@@ -127,14 +97,6 @@
|
|
|
127
97
|
margin-top: 5px;
|
|
128
98
|
}
|
|
129
99
|
|
|
130
|
-
.card .coorpmanager .author {
|
|
131
|
-
margin-top: 0px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.externalContent.coorpmanager .author {
|
|
135
|
-
margin-top: 5px;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
100
|
.hero .author {
|
|
139
101
|
margin-top: 9px;
|
|
140
102
|
margin-bottom: 24px;
|
|
@@ -217,11 +179,6 @@
|
|
|
217
179
|
background: light;
|
|
218
180
|
}
|
|
219
181
|
|
|
220
|
-
.coorpmanager .progressWrapper {
|
|
221
|
-
height: 2px;
|
|
222
|
-
margin: 11px auto;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
182
|
.card .progressWrapper {
|
|
226
183
|
width: 150px;
|
|
227
184
|
}
|
|
@@ -236,21 +193,12 @@
|
|
|
236
193
|
font-weight: 700;
|
|
237
194
|
}
|
|
238
195
|
|
|
239
|
-
.coorpmanager.externalContent .contentTypeInfo {
|
|
240
|
-
font-size: 6px;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
196
|
.externalContent .cardInfo {
|
|
244
197
|
flex-grow: 2;
|
|
245
198
|
max-height: 115px;
|
|
246
199
|
overflow: hidden;
|
|
247
200
|
}
|
|
248
201
|
|
|
249
|
-
.coorpmanager.externalContent .cardInfo {
|
|
250
|
-
flex-grow: 2;
|
|
251
|
-
max-height: 79px;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
202
|
@media mobile {
|
|
255
203
|
.author {
|
|
256
204
|
font-size: 12px;
|
|
@@ -10,8 +10,6 @@ var _ = _interopRequireDefault(require(".."));
|
|
|
10
10
|
|
|
11
11
|
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
12
|
|
|
13
|
-
var _withMultipleErrors = _interopRequireDefault(require("./fixtures/with-multiple-errors"));
|
|
14
|
-
|
|
15
13
|
var _withSelectedItem = _interopRequireDefault(require("./fixtures/with-selected-item"));
|
|
16
14
|
|
|
17
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -23,6 +21,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
23
21
|
});
|
|
24
22
|
});
|
|
25
23
|
(0, _ava.default)('Molecule › MoleculeVerticalTabs › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
26
|
-
(0, _ava.default)('Molecule › MoleculeVerticalTabs › WithMultipleErrors › should be rendered', _renderComponent.default, _.default, _withMultipleErrors.default);
|
|
27
24
|
(0, _ava.default)('Molecule › MoleculeVerticalTabs › WithSelectedItem › should be rendered', _renderComponent.default, _.default, _withSelectedItem.default);
|
|
28
25
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/vertical-tabs/test/fixtures.js"],"names":["t","pass","MoleculeVerticalTabs","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/vertical-tabs/test/fixtures.js"],"names":["t","pass","MoleculeVerticalTabs","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureWithSelectedItem"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,+DAAL,EAAsEA,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAqBC,SAA7B,EAAwC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,gEAAL,EAAuEG,wBAAvE,EAA6FN,SAA7F,EAAmHO,gBAAnH;AACA,kBAAK,yEAAL,EAAgFD,wBAAhF,EAAsGN,SAAtG,EAA4HQ,yBAA5H","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeVerticalTabs from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithSelectedItem from './fixtures/with-selected-item';\n\ntest('Molecule › MoleculeVerticalTabs > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeVerticalTabs.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeVerticalTabs.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeVerticalTabs › Default › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureDefault);\ntest('Molecule › MoleculeVerticalTabs › WithSelectedItem › should be rendered', renderComponentMacro, MoleculeVerticalTabs, fixtureWithSelectedItem);\n"],"file":"fixtures.js"}
|