@coorpacademy/components 10.1.12 → 10.2.0
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/button-link/index.js +1 -1
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link-icon-only/index.js +1 -1
- package/es/atom/button-link-icon-only/index.js.map +1 -1
- package/es/atom/button-menu/index.js +2 -4
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/chips/style.css +1 -2
- package/es/atom/image-upload/index.js +5 -3
- package/es/atom/image-upload/index.js.map +1 -1
- package/es/atom/input-checkbox/index.js +9 -3
- package/es/atom/input-checkbox/index.js.map +1 -1
- package/es/atom/input-checkbox/style.css +15 -0
- package/es/atom/input-color/style.css +1 -1
- package/es/hoc/transition/index.js +10 -3
- package/es/hoc/transition/index.js.map +1 -1
- package/es/molecule/banner/index.js +16 -7
- package/es/molecule/banner/index.js.map +1 -1
- package/es/molecule/banner/style.css +47 -0
- package/es/molecule/banner/test/fixtures/default.js +1 -1
- package/es/molecule/banner/test/fixtures/default.js.map +1 -1
- package/es/molecule/banner/test/fixtures/error-temporary-banner.js +8 -0
- package/es/molecule/banner/test/fixtures/error-temporary-banner.js.map +1 -0
- package/es/molecule/banner/test/fixtures/success-banner.js +7 -0
- package/es/molecule/banner/test/fixtures/success-banner.js.map +1 -0
- package/es/molecule/banner/test/fixtures/success-temporary-banner.js +8 -0
- package/es/molecule/banner/test/fixtures/success-temporary-banner.js.map +1 -0
- package/es/molecule/banner/test/fixtures/warning-temporary-banner.js +8 -0
- package/es/molecule/banner/test/fixtures/warning-temporary-banner.js.map +1 -0
- package/es/molecule/banner/test/fixtures.js +4 -0
- package/es/molecule/banner/test/fixtures.js.map +1 -1
- package/es/molecule/brand-create-form/index.js +4 -1
- package/es/molecule/brand-create-form/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +1 -5
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/style.css +11 -7
- package/es/molecule/card/index.js +1 -1
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
- package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
- package/es/molecule/search/test/fixtures.js +15 -0
- package/es/molecule/search/test/fixtures.js.map +1 -0
- package/es/molecule/select-multiple/index.js +100 -17
- package/es/molecule/select-multiple/index.js.map +1 -1
- package/es/molecule/select-multiple/style.css +293 -11
- package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js +32 -0
- package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js.map +1 -0
- package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-error.js +32 -0
- package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-error.js.map +1 -0
- package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-multiple.js +32 -0
- package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-multiple.js.map +1 -0
- package/es/molecule/select-multiple/test/fixtures/checked-cm-theme.js +32 -0
- package/es/molecule/select-multiple/test/fixtures/checked-cm-theme.js.map +1 -0
- package/es/molecule/select-multiple/test/fixtures/setup-theme-error.js +1 -1
- package/es/molecule/select-multiple/test/fixtures/setup-theme-error.js.map +1 -1
- package/es/molecule/select-multiple/test/fixtures.js +8 -0
- package/es/molecule/select-multiple/test/fixtures.js.map +1 -1
- package/es/molecule/share/index.js +3 -2
- package/es/molecule/share/index.js.map +1 -1
- package/es/molecule/wizard-summary/index.js +16 -10
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/organism/accordion/container/index.js +1 -1
- package/es/organism/accordion/container/index.js.map +1 -1
- package/es/organism/accordion/coorp-manager/index.js +6 -3
- package/es/organism/accordion/coorp-manager/index.js.map +1 -1
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js +26 -0
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
- package/es/organism/list-item/index.js +3 -3
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +14 -10
- package/es/organism/list-items/index.js +40 -0
- package/es/organism/list-items/index.js.map +1 -0
- package/es/organism/list-items/style.css +39 -0
- package/es/organism/list-items/test/fixtures/archived.js +24 -0
- package/es/organism/list-items/test/fixtures/archived.js.map +1 -0
- package/es/organism/list-items/test/fixtures/draft.js +24 -0
- package/es/organism/list-items/test/fixtures/draft.js.map +1 -0
- package/es/organism/list-items/test/fixtures/published.js +26 -0
- package/es/organism/list-items/test/fixtures/published.js.map +1 -0
- package/es/template/back-office/brand-update/index.js +13 -6
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +57 -13
- package/es/template/teams-dashboard/index.js +4 -6
- package/es/template/teams-dashboard/index.js.map +1 -1
- package/lib/atom/button-link/index.js +1 -1
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link-icon-only/index.js +1 -1
- package/lib/atom/button-link-icon-only/index.js.map +1 -1
- package/lib/atom/button-menu/index.js +2 -4
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/chips/style.css +1 -2
- package/lib/atom/image-upload/index.js +5 -2
- package/lib/atom/image-upload/index.js.map +1 -1
- package/lib/atom/input-checkbox/index.js +10 -3
- package/lib/atom/input-checkbox/index.js.map +1 -1
- package/lib/atom/input-checkbox/style.css +15 -0
- package/lib/atom/input-color/style.css +1 -1
- package/lib/hoc/transition/index.js +10 -3
- package/lib/hoc/transition/index.js.map +1 -1
- package/lib/molecule/banner/index.js +17 -6
- package/lib/molecule/banner/index.js.map +1 -1
- package/lib/molecule/banner/style.css +47 -0
- package/lib/molecule/banner/test/fixtures/default.js +1 -1
- package/lib/molecule/banner/test/fixtures/default.js.map +1 -1
- package/lib/molecule/banner/test/fixtures/error-temporary-banner.js +13 -0
- package/lib/molecule/banner/test/fixtures/error-temporary-banner.js.map +1 -0
- package/lib/molecule/banner/test/fixtures/success-banner.js +12 -0
- package/lib/molecule/banner/test/fixtures/success-banner.js.map +1 -0
- package/lib/molecule/banner/test/fixtures/success-temporary-banner.js +13 -0
- package/lib/molecule/banner/test/fixtures/success-temporary-banner.js.map +1 -0
- package/lib/molecule/banner/test/fixtures/warning-temporary-banner.js +13 -0
- package/lib/molecule/banner/test/fixtures/warning-temporary-banner.js.map +1 -0
- package/lib/molecule/banner/test/fixtures.js +6 -0
- package/lib/molecule/banner/test/fixtures.js.map +1 -1
- package/lib/molecule/brand-create-form/index.js +4 -1
- package/lib/molecule/brand-create-form/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +1 -5
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/style.css +11 -7
- package/lib/molecule/card/index.js +1 -1
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/search/test/fixtures.js +25 -0
- package/lib/molecule/search/test/fixtures.js.map +1 -0
- package/lib/molecule/select-multiple/index.js +102 -16
- package/lib/molecule/select-multiple/index.js.map +1 -1
- package/lib/molecule/select-multiple/style.css +293 -11
- package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js +37 -0
- package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js.map +1 -0
- package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-error.js +37 -0
- package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-error.js.map +1 -0
- package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-multiple.js +37 -0
- package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-multiple.js.map +1 -0
- package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme.js +37 -0
- package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme.js.map +1 -0
- package/lib/molecule/select-multiple/test/fixtures/setup-theme-error.js +1 -1
- package/lib/molecule/select-multiple/test/fixtures/setup-theme-error.js.map +1 -1
- package/lib/molecule/select-multiple/test/fixtures.js +12 -0
- package/lib/molecule/select-multiple/test/fixtures.js.map +1 -1
- package/lib/molecule/share/index.js +2 -1
- package/lib/molecule/share/index.js.map +1 -1
- package/lib/molecule/wizard-summary/index.js +16 -10
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/organism/accordion/container/index.js +1 -1
- package/lib/organism/accordion/container/index.js.map +1 -1
- package/lib/organism/accordion/coorp-manager/index.js +5 -3
- package/lib/organism/accordion/coorp-manager/index.js.map +1 -1
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +26 -0
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
- package/lib/organism/list-item/index.js +3 -3
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +14 -10
- package/lib/organism/list-items/index.js +53 -0
- package/lib/organism/list-items/index.js.map +1 -0
- package/lib/organism/list-items/style.css +39 -0
- package/lib/organism/list-items/test/fixtures/archived.js +33 -0
- package/lib/organism/list-items/test/fixtures/archived.js.map +1 -0
- package/lib/organism/list-items/test/fixtures/draft.js +33 -0
- package/lib/organism/list-items/test/fixtures/draft.js.map +1 -0
- package/lib/organism/list-items/test/fixtures/published.js +36 -0
- package/lib/organism/list-items/test/fixtures/published.js.map +1 -0
- package/lib/template/back-office/brand-update/index.js +14 -6
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +57 -13
- package/lib/template/teams-dashboard/index.js +4 -6
- package/lib/template/teams-dashboard/index.js.map +1 -1
- package/package.json +3 -2
- package/es/molecule/short-lived-banner/test/fixtures.js +0 -15
- package/es/molecule/short-lived-banner/test/fixtures.js.map +0 -1
- package/lib/molecule/short-lived-banner/test/fixtures.js +0 -25
- package/lib/molecule/short-lived-banner/test/fixtures.js.map +0 -1
|
@@ -6,41 +6,45 @@
|
|
|
6
6
|
@value primaryAdd1 from colors;
|
|
7
7
|
|
|
8
8
|
.wrapper {
|
|
9
|
-
|
|
10
|
-
border-radius: 7px;
|
|
9
|
+
align-items: center;
|
|
11
10
|
background-color: color(xtraLightGrey a(90%));
|
|
12
|
-
|
|
11
|
+
border-radius: 7px;
|
|
12
|
+
box-sizing: border-box;
|
|
13
13
|
display: flex;
|
|
14
|
-
|
|
14
|
+
height: 60px;
|
|
15
15
|
justify-content: space-between;
|
|
16
16
|
padding: 0 24px;
|
|
17
|
-
|
|
17
|
+
width: 100%;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.title {
|
|
21
|
+
color: cm_grey_900;
|
|
21
22
|
flex-grow: 0;
|
|
22
23
|
font-family: Gilroy;
|
|
23
24
|
font-size: 16px;
|
|
24
|
-
font-weight: bold;
|
|
25
25
|
font-stretch: normal;
|
|
26
26
|
font-style: normal;
|
|
27
|
+
font-weight: bold;
|
|
27
28
|
line-height: 1.38;
|
|
28
29
|
letter-spacing: normal;
|
|
29
|
-
|
|
30
|
-
color: cm_grey_900;
|
|
30
|
+
margin-right: 24px;
|
|
31
31
|
overflow: hidden;
|
|
32
|
+
text-align: left;
|
|
32
33
|
text-overflow: ellipsis;
|
|
33
34
|
white-space: nowrap;
|
|
35
|
+
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
.settings {
|
|
37
|
-
display: flex;
|
|
38
|
-
height: 100%;
|
|
39
39
|
align-items: center;
|
|
40
|
+
display: flex;
|
|
41
|
+
height: 100%;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
.tag {
|
|
43
45
|
margin: 0 16px 0 0;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
white-space: nowrap;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
.edit {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _listItem = _interopRequireDefault(require("../list-item"));
|
|
11
|
+
|
|
12
|
+
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
13
|
+
|
|
14
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
15
|
+
|
|
16
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
const ListItems = ({
|
|
21
|
+
title,
|
|
22
|
+
buttonLink,
|
|
23
|
+
items,
|
|
24
|
+
'aria-label': ariaLabel
|
|
25
|
+
}) => {
|
|
26
|
+
const itemsView = items.map(item => /*#__PURE__*/_react.default.createElement("li", {
|
|
27
|
+
key: item.id,
|
|
28
|
+
className: _style.default.item
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_listItem.default, item)));
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
+
className: _style.default.header
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
className: _style.default.title
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_title.default, {
|
|
35
|
+
title: title,
|
|
36
|
+
type: 'form-group'
|
|
37
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
+
className: _style.default.buttonCreate
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonLink))), /*#__PURE__*/_react.default.createElement("ul", {
|
|
40
|
+
className: _style.default.list,
|
|
41
|
+
"aria-label": ariaLabel
|
|
42
|
+
}, itemsView));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
ListItems.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
46
|
+
'aria-label': _propTypes.default.string,
|
|
47
|
+
buttonLink: _propTypes.default.shape(_buttonLink.default.propTypes),
|
|
48
|
+
items: _propTypes.default.arrayOf(_propTypes.default.shape(_listItem.default.propTypes)),
|
|
49
|
+
title: _propTypes.default.string
|
|
50
|
+
} : {};
|
|
51
|
+
var _default = ListItems;
|
|
52
|
+
exports.default = _default;
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/organism/list-items/index.js"],"names":["ListItems","title","buttonLink","items","ariaLabel","itemsView","map","item","id","style","header","buttonCreate","list","propTypes","PropTypes","string","shape","ButtonLink","arrayOf","ListItem"],"mappings":";;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;AAACC,EAAAA,KAAD;AAAQC,EAAAA,UAAR;AAAoBC,EAAAA,KAApB;AAA2B,gBAAcC;AAAzC,CAAD,KAAyD;AACzE,QAAMC,SAAS,GAAGF,KAAK,CAACG,GAAN,CAAUC,IAAI,iBAC9B;AAAI,IAAA,GAAG,EAAEA,IAAI,CAACC,EAAd;AAAkB,IAAA,SAAS,EAAEC,eAAMF;AAAnC,kBACE,6BAAC,iBAAD,EAAcA,IAAd,CADF,CADgB,CAAlB;AAMA,sBACE,uDACE;AAAK,IAAA,SAAS,EAAEE,eAAMC;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAED,eAAMR;AAAtB,kBACE,6BAAC,cAAD;AAAO,IAAA,KAAK,EAAEA,KAAd;AAAqB,IAAA,IAAI,EAAE;AAA3B,IADF,CADF,eAIE;AAAK,IAAA,SAAS,EAAEQ,eAAME;AAAtB,kBACE,6BAAC,mBAAD,EAAgBT,UAAhB,CADF,CAJF,CADF,eASE;AAAI,IAAA,SAAS,EAAEO,eAAMG,IAArB;AAA2B,kBAAYR;AAAvC,KACGC,SADH,CATF,CADF;AAeD,CAtBD;;AAwBAL,SAAS,CAACa,SAAV,2CAAsB;AACpB,gBAAcC,mBAAUC,MADJ;AAEpBb,EAAAA,UAAU,EAAEY,mBAAUE,KAAV,CAAgBC,oBAAWJ,SAA3B,CAFQ;AAGpBV,EAAAA,KAAK,EAAEW,mBAAUI,OAAV,CAAkBJ,mBAAUE,KAAV,CAAgBG,kBAASN,SAAzB,CAAlB,CAHa;AAIpBZ,EAAAA,KAAK,EAAEa,mBAAUC;AAJG,CAAtB;eAOef,S","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport ListItem from '../list-item';\nimport Title from '../../atom/title';\n\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst ListItems = ({title, buttonLink, items, 'aria-label': ariaLabel}) => {\n const itemsView = items.map(item => (\n <li key={item.id} className={style.item}>\n <ListItem {...item} />\n </li>\n ));\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} />\n </div>\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n <ul className={style.list} aria-label={ariaLabel}>\n {itemsView}\n </ul>\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@value breakpoints: "../../variables/breakpoints.css";
|
|
2
|
+
@value mobile from breakpoints;
|
|
3
|
+
@value colors: "../../variables/colors.css";
|
|
4
|
+
@value medium from colors;
|
|
5
|
+
@value xtraLightGrey from colors;
|
|
6
|
+
@value dark from colors;
|
|
7
|
+
|
|
8
|
+
.header {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
padding: 0 24px;
|
|
13
|
+
margin-bottom: 24px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.title {
|
|
17
|
+
font-family: Gilroy;
|
|
18
|
+
font-size: 20px;
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
font-stretch: normal;
|
|
21
|
+
font-style: normal;
|
|
22
|
+
line-height: 1.4;
|
|
23
|
+
letter-spacing: normal;
|
|
24
|
+
text-align: left;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.buttonCreate {
|
|
28
|
+
width: 194px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.item {
|
|
32
|
+
margin-bottom: 8px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.list {
|
|
36
|
+
list-style-type: none;
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: 0;
|
|
39
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _archived = _interopRequireDefault(require("../../../list-item/test/fixtures/archived"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
const ids = ['1', '2', '3'];
|
|
13
|
+
const listeItems = ids.map(id => {
|
|
14
|
+
return _extends(_extends({}, _archived.default.props), {}, {
|
|
15
|
+
id
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
var _default = {
|
|
19
|
+
props: {
|
|
20
|
+
title: `${listeItems.length} custom playlists`,
|
|
21
|
+
'aria-label': 'aria list',
|
|
22
|
+
buttonLink: {
|
|
23
|
+
type: 'primary',
|
|
24
|
+
label: 'Create custom playlist',
|
|
25
|
+
'aria-label': 'aria button',
|
|
26
|
+
'data-name': 'default-button',
|
|
27
|
+
onClick: () => console.log('click')
|
|
28
|
+
},
|
|
29
|
+
items: listeItems
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.default = _default;
|
|
33
|
+
//# sourceMappingURL=archived.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/list-items/test/fixtures/archived.js"],"names":["ids","listeItems","map","id","archivedItem","props","title","length","buttonLink","type","label","onClick","console","log","items"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAMA,GAAG,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAZ;AACA,MAAMC,UAAU,GAAGD,GAAG,CAACE,GAAJ,CAAQC,EAAE,IAAI;AAC/B,+BACKC,kBAAaC,KADlB;AAEEF,IAAAA;AAFF;AAID,CALkB,CAAnB;eAOe;AACbE,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAG,GAAEL,UAAU,CAACM,MAAO,mBADvB;AAEL,kBAAc,WAFT;AAGLC,IAAAA,UAAU,EAAE;AACVC,MAAAA,IAAI,EAAE,SADI;AAEVC,MAAAA,KAAK,EAAE,wBAFG;AAGV,oBAAc,aAHJ;AAIV,mBAAa,gBAJH;AAKVC,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALL,KAHP;AAULC,IAAAA,KAAK,EAAEb;AAVF;AADM,C","sourcesContent":["import archivedItem from '../../../list-item/test/fixtures/archived';\n\nconst ids = ['1', '2', '3'];\nconst listeItems = ids.map(id => {\n return {\n ...archivedItem.props,\n id\n };\n});\n\nexport default {\n props: {\n title: `${listeItems.length} custom playlists`,\n 'aria-label': 'aria list',\n buttonLink: {\n type: 'primary',\n label: 'Create custom playlist',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n onClick: () => console.log('click')\n },\n items: listeItems\n }\n};\n"],"file":"archived.js"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _draft = _interopRequireDefault(require("../../../list-item/test/fixtures/draft"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
const ids = ['1', '2', '3'];
|
|
13
|
+
const listeItems = ids.map(id => {
|
|
14
|
+
return _extends(_extends({}, _draft.default.props), {}, {
|
|
15
|
+
id
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
var _default = {
|
|
19
|
+
props: {
|
|
20
|
+
title: `${listeItems.length} custom playlists`,
|
|
21
|
+
'aria-label': 'aria list',
|
|
22
|
+
buttonLink: {
|
|
23
|
+
type: 'primary',
|
|
24
|
+
label: 'Create custom playlist',
|
|
25
|
+
'aria-label': 'aria button',
|
|
26
|
+
'data-name': 'default-button',
|
|
27
|
+
onClick: () => console.log('click')
|
|
28
|
+
},
|
|
29
|
+
items: listeItems
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.default = _default;
|
|
33
|
+
//# sourceMappingURL=draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/list-items/test/fixtures/draft.js"],"names":["ids","listeItems","map","id","draftItem","props","title","length","buttonLink","type","label","onClick","console","log","items"],"mappings":";;;;;AAAA;;;;;;AAEA,MAAMA,GAAG,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAZ;AACA,MAAMC,UAAU,GAAGD,GAAG,CAACE,GAAJ,CAAQC,EAAE,IAAI;AAC/B,+BACKC,eAAUC,KADf;AAEEF,IAAAA;AAFF;AAID,CALkB,CAAnB;eAOe;AACbE,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAG,GAAEL,UAAU,CAACM,MAAO,mBADvB;AAEL,kBAAc,WAFT;AAGLC,IAAAA,UAAU,EAAE;AACVC,MAAAA,IAAI,EAAE,SADI;AAEVC,MAAAA,KAAK,EAAE,wBAFG;AAGV,oBAAc,aAHJ;AAIV,mBAAa,gBAJH;AAKVC,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALL,KAHP;AAULC,IAAAA,KAAK,EAAEb;AAVF;AADM,C","sourcesContent":["import draftItem from '../../../list-item/test/fixtures/draft';\n\nconst ids = ['1', '2', '3'];\nconst listeItems = ids.map(id => {\n return {\n ...draftItem.props,\n id\n };\n});\n\nexport default {\n props: {\n title: `${listeItems.length} custom playlists`,\n 'aria-label': 'aria list',\n buttonLink: {\n type: 'primary',\n label: 'Create custom playlist',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n onClick: () => console.log('click')\n },\n items: listeItems\n }\n};\n"],"file":"draft.js"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _published = _interopRequireDefault(require("../../../list-item/test/fixtures/published"));
|
|
7
|
+
|
|
8
|
+
var _revised = _interopRequireDefault(require("../../../list-item/test/fixtures/revised"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
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); }
|
|
13
|
+
|
|
14
|
+
const propsRevised = _revised.default.props;
|
|
15
|
+
const ids = ['1', '2', '3'];
|
|
16
|
+
const listePublishedItems = ids.map(id => {
|
|
17
|
+
return _extends(_extends({}, _published.default.props), {}, {
|
|
18
|
+
id
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
var _default = {
|
|
22
|
+
props: {
|
|
23
|
+
title: `${listePublishedItems.length + 1} custom playlists`,
|
|
24
|
+
'aria-label': 'aria list',
|
|
25
|
+
buttonLink: {
|
|
26
|
+
type: 'primary',
|
|
27
|
+
label: 'Create custom playlist',
|
|
28
|
+
'aria-label': 'aria button',
|
|
29
|
+
'data-name': 'default-button',
|
|
30
|
+
onClick: () => console.log('click')
|
|
31
|
+
},
|
|
32
|
+
items: [...listePublishedItems, propsRevised]
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.default = _default;
|
|
36
|
+
//# sourceMappingURL=published.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/list-items/test/fixtures/published.js"],"names":["propsRevised","revisedItem","props","ids","listePublishedItems","map","id","publishedItem","title","length","buttonLink","type","label","onClick","console","log","items"],"mappings":";;;;;AAAA;;AACA;;;;;;AAEA,MAAMA,YAAY,GAAGC,iBAAYC,KAAjC;AAEA,MAAMC,GAAG,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAZ;AACA,MAAMC,mBAAmB,GAAGD,GAAG,CAACE,GAAJ,CAAQC,EAAE,IAAI;AACxC,+BACKC,mBAAcL,KADnB;AAEEI,IAAAA;AAFF;AAID,CAL2B,CAA5B;eAOe;AACbJ,EAAAA,KAAK,EAAE;AACLM,IAAAA,KAAK,EAAG,GAAEJ,mBAAmB,CAACK,MAApB,GAA6B,CAAE,mBADpC;AAEL,kBAAc,WAFT;AAGLC,IAAAA,UAAU,EAAE;AACVC,MAAAA,IAAI,EAAE,SADI;AAEVC,MAAAA,KAAK,EAAE,wBAFG;AAGV,oBAAc,aAHJ;AAIV,mBAAa,gBAJH;AAKVC,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALL,KAHP;AAULC,IAAAA,KAAK,EAAE,CAAC,GAAGZ,mBAAJ,EAAyBJ,YAAzB;AAVF;AADM,C","sourcesContent":["import publishedItem from '../../../list-item/test/fixtures/published';\nimport revisedItem from '../../../list-item/test/fixtures/revised';\n\nconst propsRevised = revisedItem.props;\n\nconst ids = ['1', '2', '3'];\nconst listePublishedItems = ids.map(id => {\n return {\n ...publishedItem.props,\n id\n };\n});\n\nexport default {\n props: {\n title: `${listePublishedItems.length + 1} custom playlists`,\n 'aria-label': 'aria list',\n buttonLink: {\n type: 'primary',\n label: 'Create custom playlist',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n onClick: () => console.log('click')\n },\n items: [...listePublishedItems, propsRevised]\n }\n};\n"],"file":"published.js"}
|
|
@@ -17,6 +17,8 @@ var _isEmpty = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
|
17
17
|
|
|
18
18
|
var _find = _interopRequireDefault(require("lodash/fp/find"));
|
|
19
19
|
|
|
20
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
+
|
|
20
22
|
var _brandTabs = _interopRequireDefault(require("../../../molecule/brand-tabs"));
|
|
21
23
|
|
|
22
24
|
var _sidebar = require("../../../organism/sidebar");
|
|
@@ -82,7 +84,7 @@ const buildLeftNavigation = (logo, items, onItemClick) => {
|
|
|
82
84
|
className: _style.default.subTabsView
|
|
83
85
|
}, subTabsView(tab.tabs)))(items);
|
|
84
86
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
-
className: _style.default.
|
|
87
|
+
className: _style.default.navigation
|
|
86
88
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
87
89
|
className: _style.default.logo
|
|
88
90
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
@@ -112,10 +114,9 @@ const buildNotifications = notifications => {
|
|
|
112
114
|
}, notificationsList);
|
|
113
115
|
};
|
|
114
116
|
|
|
115
|
-
const buildHeader =
|
|
116
|
-
const headerStyle = (0, _isEmpty.default)(notifications) ? _style.default.header : _style.default.headerForNotifications;
|
|
117
|
+
const buildHeader = header => {
|
|
117
118
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
118
|
-
className:
|
|
119
|
+
className: _style.default.header
|
|
119
120
|
}, /*#__PURE__*/_react.default.createElement(_setupHeader.default, header));
|
|
120
121
|
};
|
|
121
122
|
|
|
@@ -179,11 +180,18 @@ const BrandUpdate = props => {
|
|
|
179
180
|
const tabsView = buildTabs(items);
|
|
180
181
|
const contentView = buildContentView(content);
|
|
181
182
|
const detailsView = buildDetailsView(details);
|
|
183
|
+
const contentStyle = (0, _classnames.default)([_style.default.content, !(0, _isEmpty.default)(notifications) && _style.default.contentWithNotifications]);
|
|
182
184
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
183
185
|
className: _style.default.container
|
|
184
|
-
},
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
187
|
+
className: _style.default.left
|
|
188
|
+
}, leftNavigation), /*#__PURE__*/_react.default.createElement("div", {
|
|
185
189
|
className: _style.default.contentWrapper
|
|
186
|
-
},
|
|
190
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
191
|
+
className: _style.default.headerSticky
|
|
192
|
+
}, headerView), /*#__PURE__*/_react.default.createElement("div", {
|
|
193
|
+
className: contentStyle
|
|
194
|
+
}, notificationsView, tabsView, contentView, detailsView)));
|
|
187
195
|
};
|
|
188
196
|
|
|
189
197
|
BrandUpdate.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/template/back-office/brand-update/index.js"],"names":["getStyle","isSelected","style","selectedElement","unselectedElement","subTabsView","_subTabs","map","convert","cap","subTab","_index","title","type","selected","buildLeftNavigation","logo","items","onItemClick","formattedTabs","key","href","index","children","iconType","formattedTabsViews","tab","tabs","leftMenu","buildNotifications","notifications","notificationsList","notification","buildHeader","header","headerStyle","headerForNotifications","buildTabs","selectedTab","e","showTabs","subTabs","buildContentView","content","buildDetailsView","details","BrandUpdate","props","leftNavigation","notificationsView","headerView","tabsView","contentView","detailsView","container","contentWrapper","defaultProps","propTypes","PropTypes","arrayOf","shape","Banner","Header","string","isRequired","bool","oneOfType","BrandForm","oneOf","BrandTable","BrandUpload","BrandAnalytics","BrandDashboard","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,QAAQ,GAAGC,UAAU,IAAKA,UAAU,GAAGC,eAAMC,eAAT,GAA2BD,eAAME,iBAA3E;;AAEA,MAAMC,WAAW,GAAG,CAACC,QAAQ,GAAG,EAAZ,KAClBC,aAAIC,OAAJ,CAAY;AAACC,EAAAA,GAAG,EAAE;AAAN,CAAZ,EAA0B,CAACC,MAAD,EAASC,MAAT,kBACxB;AAAK,EAAA,GAAG,EAAED,MAAM,CAACE;AAAjB,GACGF,MAAM,CAACG,IAAP,KAAgB,UAAhB,gBACC,6BAAC,qBAAD,eACMH,MADN;AAEE,EAAA,MAAM,EAAEV,QAAQ,CAACU,MAAM,CAACI,QAAR,CAFlB;AAGE,EAAA,SAAS,EAAE,KAHb;AAIE,EAAA,MAAM,EAAE;AAJV,GADD,gBAQC,6BAAC,iBAAD,eAAcJ,MAAd;AAAsB,EAAA,MAAM,EAAEV,QAAQ,CAACU,MAAM,CAACI,QAAR,CAAtC;AAAyD,EAAA,SAAS,EAAE;AAApE,GATJ,CADF,EAaGR,QAbH,CADF,C,CAgBA;;;AACA,MAAMS,mBAAmB,GAAG,CAACC,IAAD,EAAOC,KAAP,EAAcC,WAAd,KAA8B;AACxD,QAAMC,aAAa,GAAGF,KAAK,CAACV,GAAN,CAAU,CAAC;AAACa,IAAAA,GAAD;AAAMR,IAAAA,KAAN;AAAaS,IAAAA,IAAb;AAAmBP,IAAAA,QAAnB;AAA6BD,IAAAA,IAAI,GAAG;AAApC,GAAD,EAAmDS,KAAnD,MAA8D;AAC5FV,IAAAA,KAD4F;AAE5FE,IAAAA,QAF4F;AA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ACKS,oBAAWZ,SADhB;AAEErC,IAAAA,GAAG,EAAEsC,mBAAUK,MAFjB;AAGElD,IAAAA,IAAI,EAAE6C,mBAAUU,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAHR,KAN2B,EAW3BV,mBAAUE,KAAV,uBACKU,qBAAYb,SADjB;AAEErC,IAAAA,GAAG,EAAEsC,mBAAUK,MAFjB;AAGElD,IAAAA,IAAI,EAAE6C,mBAAUU,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAHR,KAX2B,EAgB3BV,mBAAUE,KAAV,uBACKW,wBAAed,SADpB;AAEErC,IAAAA,GAAG,EAAEsC,mBAAUK,MAFjB;AAGElD,IAAAA,IAAI,EAAE6C,mBAAUU,KAAV,CAAgB,CAAC,sBAAD,CAAhB;AAHR,KAhB2B,EAqB3BV,mBAAUE,KAAV,uBACKY,wBAAef,SADpB;AAEErC,IAAAA,GAAG,EAAEsC,mBAAUK,MAFjB;AAGElD,IAAAA,IAAI,EAAE6C,mBAAUU,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAHR,KArB2B,CAApB,CA5Ba;AAuDtBvB,EAAAA,OAAO,EAAEa,mBAAUE,KAAV,uBACJS,oBAAWZ,SADP;AAEPrC,IAAAA,GAAG,EAAEsC,mBAAUK,MAFR;AAGPlD,IAAAA,IAAI,EAAE6C,mBAAUU,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAHC,KAvDa;AA4DtBlD,EAAAA,WAAW,EAAEwC,mBAAUe;AA5DD,CAAxB;eA+De3B,W","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport map from 'lodash/fp/map';\nimport pipe from 'lodash/fp/pipe';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport find from 'lodash/fp/find';\nimport BrandTabs from '../../../molecule/brand-tabs';\nimport {IconLinkItem, LinkItem} from '../../../organism/sidebar';\nimport BrandForm from '../../../organism/brand-form';\nimport BrandTable from '../../../organism/brand-table';\nimport BrandUpload from '../../../organism/brand-upload';\nimport BrandAnalytics from '../../../organism/brand-analytics';\nimport BrandDashboard from '../../../organism/brand-dashboard';\nimport Banner from '../../../molecule/banner';\nimport Header from '../../../organism/setup-header';\nimport Loader from '../../../atom/loader';\nimport Accordion from '../../../organism/accordion/coorp-manager';\nimport style from './style.css';\n\nconst getStyle = isSelected => (isSelected ? style.selectedElement : style.unselectedElement);\n\nconst subTabsView = (_subTabs = []) =>\n map.convert({cap: false})((subTab, _index) => (\n <div key={subTab.title}>\n {subTab.type === 'iconLink' ? (\n <IconLinkItem\n {...subTab}\n styles={getStyle(subTab.selected)}\n uppercase={false}\n target={'_blank'}\n />\n ) : (\n <LinkItem {...subTab} styles={getStyle(subTab.selected)} uppercase={false} />\n )}\n </div>\n ))(_subTabs);\n\n// TODO: this fonction should be replaced by a molecule to avoid this file to be unreadable\nconst buildLeftNavigation = (logo, items, onItemClick) => {\n const formattedTabs = items.map(({key, title, href, selected, type = 'simpleTab'}, index) => ({\n title,\n selected,\n type,\n href,\n index,\n children: [],\n iconType: key || 'arrow'\n }));\n\n const formattedTabsViews = map(tab => (\n <div key={tab.title} className={style.subTabsView}>\n {subTabsView(tab.tabs)}\n </div>\n ))(items);\n\n return (\n <div className={style.leftMenu}>\n <div className={style.logo}>\n <a href=\"/\">\n <img src={logo} />\n </a>\n </div>\n <Accordion tabProps={formattedTabs} theme={'setup'} onClick={onItemClick}>\n {formattedTabsViews}\n </Accordion>\n </div>\n );\n};\n\nconst buildNotifications = notifications => {\n if (isEmpty(notifications)) {\n return null;\n }\n\n const notificationsList = notifications.map((notification, index) => {\n return (\n <div className={style.notification} key={index}>\n <Banner {...notification} />\n </div>\n );\n });\n return <div className={style.notifications}>{notificationsList}</div>;\n};\n\nconst buildHeader = (header, notifications) => {\n const headerStyle = isEmpty(notifications) ? style.header : style.headerForNotifications;\n return (\n <div className={headerStyle}>\n <Header {...header} />\n </div>\n );\n};\n\nconst buildTabs = items => {\n const selectedTab = pipe(\n find(e => e.selected),\n get('tabs'),\n find(e => e.selected)\n )(items);\n\n const showTabs = selectedTab && !isEmpty(selectedTab.subTabs);\n if (!showTabs) return null;\n return (\n <div className={style.tabs}>\n <BrandTabs type=\"light\" tabs={selectedTab.subTabs} />\n </div>\n );\n};\n\nconst buildContentView = content => {\n if (!content) {\n return (\n <div>\n <Loader />\n </div>\n );\n }\n\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'list':\n return <BrandTable {...content} />;\n case 'upload':\n return <BrandUpload {...content} />;\n case 'analytics-dashboards':\n return <BrandAnalytics {...content} />;\n case 'home':\n return <BrandDashboard {...content} />;\n }\n};\n\nconst buildDetailsView = details => {\n if (!details) return;\n return <BrandTable {...details} />;\n};\n\nconst BrandUpdate = props => {\n const {notifications, header, items, content, details, onItemClick} = props;\n const logo = 'https://static.coorpacademy.com/logo/coorp-manager.svg';\n\n const leftNavigation = buildLeftNavigation(logo, items, onItemClick);\n const notificationsView = buildNotifications(notifications);\n const headerView = buildHeader(header, notifications);\n const tabsView = buildTabs(items);\n const contentView = buildContentView(content);\n const detailsView = buildDetailsView(details);\n\n return (\n <div className={style.container}>\n {leftNavigation}\n <div className={style.contentWrapper}>\n {headerView}\n {notificationsView}\n {tabsView}\n {contentView}\n {detailsView}\n </div>\n </div>\n );\n};\n\nBrandUpdate.defaultProps = {\n notifications: []\n};\n\nBrandUpdate.propTypes = {\n notifications: PropTypes.arrayOf(PropTypes.shape(Banner.propTypes)),\n header: PropTypes.shape({...Header.propTypes}),\n items: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string,\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string,\n subTabs: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string\n })\n )\n })\n )\n })\n ).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...BrandTable.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list'])\n }),\n PropTypes.shape({\n ...BrandUpload.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['upload'])\n }),\n PropTypes.shape({\n ...BrandAnalytics.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['analytics-dashboards'])\n }),\n PropTypes.shape({\n ...BrandDashboard.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['home'])\n })\n ]),\n details: PropTypes.shape({\n ...BrandTable.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list'])\n }),\n onItemClick: PropTypes.func\n};\n\nexport default BrandUpdate;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/template/back-office/brand-update/index.js"],"names":["getStyle","isSelected","style","selectedElement","unselectedElement","subTabsView","_subTabs","map","convert","cap","subTab","_index","title","type","selected","buildLeftNavigation","logo","items","onItemClick","formattedTabs","key","href","index","children","iconType","formattedTabsViews","tab","tabs","navigation","buildNotifications","notifications","notificationsList","notification","buildHeader","header","buildTabs","selectedTab","e","showTabs","subTabs","buildContentView","content","buildDetailsView","details","BrandUpdate","props","leftNavigation","notificationsView","headerView","tabsView","contentView","detailsView","contentStyle","contentWithNotifications","container","left","contentWrapper","headerSticky","defaultProps","propTypes","PropTypes","arrayOf","shape","Banner","Header","string","isRequired","bool","oneOfType","BrandForm","oneOf","BrandTable","BrandUpload","BrandAnalytics","BrandDashboard","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;A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AEwC,mBAAUK,MAFjB;AAGEpD,IAAAA,IAAI,EAAE+C,mBAAUU,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAHR,KAN2B,EAW3BV,mBAAUE,KAAV,uBACKU,qBAAYb,SADjB;AAEEvC,IAAAA,GAAG,EAAEwC,mBAAUK,MAFjB;AAGEpD,IAAAA,IAAI,EAAE+C,mBAAUU,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAHR,KAX2B,EAgB3BV,mBAAUE,KAAV,uBACKW,wBAAed,SADpB;AAEEvC,IAAAA,GAAG,EAAEwC,mBAAUK,MAFjB;AAGEpD,IAAAA,IAAI,EAAE+C,mBAAUU,KAAV,CAAgB,CAAC,sBAAD,CAAhB;AAHR,KAhB2B,EAqB3BV,mBAAUE,KAAV,uBACKY,wBAAef,SADpB;AAEEvC,IAAAA,GAAG,EAAEwC,mBAAUK,MAFjB;AAGEpD,IAAAA,IAAI,EAAE+C,mBAAUU,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAHR,KArB2B,CAApB,CA5Ba;AAuDtB3B,EAAAA,OAAO,EAAEiB,mBAAUE,KAAV,uBACJS,oBAAWZ,SADP;AAEPvC,IAAAA,GAAG,EAAEwC,mBAAUK,MAFR;AAGPpD,IAAAA,IAAI,EAAE+C,mBAAUU,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAHC,KAvDa;AA4DtBpD,EAAAA,WAAW,EAAE0C,mBAAUe;AA5DD,CAAxB;eA+De/B,W","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport map from 'lodash/fp/map';\nimport pipe from 'lodash/fp/pipe';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport find from 'lodash/fp/find';\nimport classNames from 'classnames';\nimport BrandTabs from '../../../molecule/brand-tabs';\nimport {IconLinkItem, LinkItem} from '../../../organism/sidebar';\nimport BrandForm from '../../../organism/brand-form';\nimport BrandTable from '../../../organism/brand-table';\nimport BrandUpload from '../../../organism/brand-upload';\nimport BrandAnalytics from '../../../organism/brand-analytics';\nimport BrandDashboard from '../../../organism/brand-dashboard';\nimport Banner from '../../../molecule/banner';\nimport Header from '../../../organism/setup-header';\nimport Loader from '../../../atom/loader';\nimport Accordion from '../../../organism/accordion/coorp-manager';\nimport style from './style.css';\n\nconst getStyle = isSelected => (isSelected ? style.selectedElement : style.unselectedElement);\n\nconst subTabsView = (_subTabs = []) =>\n map.convert({cap: false})((subTab, _index) => (\n <div key={subTab.title}>\n {subTab.type === 'iconLink' ? (\n <IconLinkItem\n {...subTab}\n styles={getStyle(subTab.selected)}\n uppercase={false}\n target={'_blank'}\n />\n ) : (\n <LinkItem {...subTab} styles={getStyle(subTab.selected)} uppercase={false} />\n )}\n </div>\n ))(_subTabs);\n\n// TODO: this fonction should be replaced by a molecule to avoid this file to be unreadable\nconst buildLeftNavigation = (logo, items, onItemClick) => {\n const formattedTabs = items.map(({key, title, href, selected, type = 'simpleTab'}, index) => ({\n title,\n selected,\n type,\n href,\n index,\n children: [],\n iconType: key || 'arrow'\n }));\n\n const formattedTabsViews = map(tab => (\n <div key={tab.title} className={style.subTabsView}>\n {subTabsView(tab.tabs)}\n </div>\n ))(items);\n\n return (\n <div className={style.navigation}>\n <div className={style.logo}>\n <a href=\"/\">\n <img src={logo} />\n </a>\n </div>\n <Accordion tabProps={formattedTabs} theme={'setup'} onClick={onItemClick}>\n {formattedTabsViews}\n </Accordion>\n </div>\n );\n};\n\nconst buildNotifications = notifications => {\n if (isEmpty(notifications)) {\n return null;\n }\n\n const notificationsList = notifications.map((notification, index) => {\n return (\n <div className={style.notification} key={index}>\n <Banner {...notification} />\n </div>\n );\n });\n return <div className={style.notifications}>{notificationsList}</div>;\n};\n\nconst buildHeader = header => {\n return (\n <div className={style.header}>\n <Header {...header} />\n </div>\n );\n};\n\nconst buildTabs = items => {\n const selectedTab = pipe(\n find(e => e.selected),\n get('tabs'),\n find(e => e.selected)\n )(items);\n\n const showTabs = selectedTab && !isEmpty(selectedTab.subTabs);\n if (!showTabs) return null;\n return (\n <div className={style.tabs}>\n <BrandTabs type=\"light\" tabs={selectedTab.subTabs} />\n </div>\n );\n};\n\nconst buildContentView = content => {\n if (!content) {\n return (\n <div>\n <Loader />\n </div>\n );\n }\n\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'list':\n return <BrandTable {...content} />;\n case 'upload':\n return <BrandUpload {...content} />;\n case 'analytics-dashboards':\n return <BrandAnalytics {...content} />;\n case 'home':\n return <BrandDashboard {...content} />;\n }\n};\n\nconst buildDetailsView = details => {\n if (!details) return;\n return <BrandTable {...details} />;\n};\n\nconst BrandUpdate = props => {\n const {notifications, header, items, content, details, onItemClick} = props;\n const logo = 'https://static.coorpacademy.com/logo/coorp-manager.svg';\n\n const leftNavigation = buildLeftNavigation(logo, items, onItemClick);\n const notificationsView = buildNotifications(notifications);\n const headerView = buildHeader(header, notifications);\n const tabsView = buildTabs(items);\n const contentView = buildContentView(content);\n const detailsView = buildDetailsView(details);\n\n const contentStyle = classNames([\n style.content,\n !isEmpty(notifications) && style.contentWithNotifications\n ]);\n\n return (\n <div className={style.container}>\n <div className={style.left}>{leftNavigation}</div>\n <div className={style.contentWrapper}>\n <div className={style.headerSticky}>{headerView}</div>\n <div className={contentStyle}>\n {notificationsView}\n {tabsView}\n {contentView}\n {detailsView}\n </div>\n </div>\n </div>\n );\n};\n\nBrandUpdate.defaultProps = {\n notifications: []\n};\n\nBrandUpdate.propTypes = {\n notifications: PropTypes.arrayOf(PropTypes.shape(Banner.propTypes)),\n header: PropTypes.shape({...Header.propTypes}),\n items: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string,\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string,\n subTabs: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n href: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n type: PropTypes.string\n })\n )\n })\n )\n })\n ).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...BrandTable.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list'])\n }),\n PropTypes.shape({\n ...BrandUpload.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['upload'])\n }),\n PropTypes.shape({\n ...BrandAnalytics.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['analytics-dashboards'])\n }),\n PropTypes.shape({\n ...BrandDashboard.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['home'])\n })\n ]),\n details: PropTypes.shape({\n ...BrandTable.propTypes,\n key: PropTypes.string,\n type: PropTypes.oneOf(['list'])\n }),\n onItemClick: PropTypes.func\n};\n\nexport default BrandUpdate;\n"],"file":"index.js"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@value colors: "../../../variables/colors.css";
|
|
2
2
|
@value light from colors;
|
|
3
|
+
@value white from colors;
|
|
3
4
|
@value xtraLightGrey from colors;
|
|
4
5
|
@value cm_grey_100 from colors;
|
|
5
6
|
@value black from colors;
|
|
@@ -11,21 +12,31 @@
|
|
|
11
12
|
@value wide from breakpoints;
|
|
12
13
|
|
|
13
14
|
.container {
|
|
14
|
-
width: 100%;
|
|
15
15
|
height: 100%;
|
|
16
16
|
scroll-behavior: unset;
|
|
17
17
|
margin: 0 auto;
|
|
18
|
-
padding-bottom: 80px 20px;
|
|
19
18
|
display: flex;
|
|
20
|
-
font-family: "Open Sans";
|
|
21
19
|
}
|
|
22
20
|
|
|
23
|
-
.
|
|
24
|
-
|
|
21
|
+
.left {
|
|
22
|
+
width: 223px;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
.
|
|
28
|
-
|
|
25
|
+
.contentWrapper {
|
|
26
|
+
width: calc(100% - 351px);
|
|
27
|
+
padding: 0 64px 0 64px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.headerSticky {
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
background-color: white;
|
|
33
|
+
position: fixed;
|
|
34
|
+
width: calc(100% - 351px);
|
|
35
|
+
z-index: 999;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.header {
|
|
39
|
+
padding: 24px 0 5px 0;
|
|
29
40
|
}
|
|
30
41
|
|
|
31
42
|
.tabs {
|
|
@@ -42,7 +53,7 @@
|
|
|
42
53
|
}
|
|
43
54
|
|
|
44
55
|
.notifications {
|
|
45
|
-
padding:
|
|
56
|
+
padding: 0 0 32px 0;
|
|
46
57
|
}
|
|
47
58
|
|
|
48
59
|
.notification {
|
|
@@ -53,18 +64,27 @@
|
|
|
53
64
|
margin-bottom: 0;
|
|
54
65
|
}
|
|
55
66
|
|
|
56
|
-
.
|
|
67
|
+
.navigation {
|
|
57
68
|
scroll-behavior: unset;
|
|
58
|
-
min-width: 223px;
|
|
59
69
|
background: xtraLightGrey;
|
|
70
|
+
position: fixed;
|
|
71
|
+
left: 0;
|
|
72
|
+
height: 100%;
|
|
73
|
+
overflow: scroll;
|
|
74
|
+
z-index: 999;
|
|
60
75
|
}
|
|
61
76
|
|
|
62
|
-
.
|
|
77
|
+
.content {
|
|
63
78
|
width: 100%;
|
|
64
|
-
padding: 0 64px;
|
|
65
79
|
display: flex;
|
|
66
80
|
flex-direction: column;
|
|
67
81
|
overflow: auto;
|
|
82
|
+
top: 124px;
|
|
83
|
+
position: relative;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.contentWithNotifications {
|
|
87
|
+
top: 100px;
|
|
68
88
|
}
|
|
69
89
|
|
|
70
90
|
.selectedElement {
|
|
@@ -90,11 +110,35 @@
|
|
|
90
110
|
margin: 32px 20px 54px 20px;
|
|
91
111
|
}
|
|
92
112
|
|
|
113
|
+
@media desktop {
|
|
114
|
+
.container {
|
|
115
|
+
scroll-behavior: unset;
|
|
116
|
+
margin: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.headerSticky {
|
|
120
|
+
width: calc(100% - 287px);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.contentWrapper {
|
|
124
|
+
width: calc(100% - 287px);
|
|
125
|
+
padding: 0 32px 0 32px;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
93
129
|
@media tablet {
|
|
94
130
|
.container {
|
|
95
131
|
scroll-behavior: unset;
|
|
96
132
|
margin: 0;
|
|
97
|
-
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.headerSticky {
|
|
136
|
+
width: calc(100% - 287px);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.contentWrapper {
|
|
140
|
+
width: calc(100% - 287px);
|
|
141
|
+
padding: 0 32px 0 32px;
|
|
98
142
|
}
|
|
99
143
|
}
|
|
100
144
|
|
|
@@ -34,15 +34,13 @@ const TeamsDashboard = ({
|
|
|
34
34
|
isLoading
|
|
35
35
|
}) => {
|
|
36
36
|
const [isShadowed, setShadowed] = (0, _react.useState)(false);
|
|
37
|
-
const onMenuOpen = (0, _react.useCallback)(() => setShadowed(true));
|
|
38
|
-
const onMenuClose = (0, _react.useCallback)(() => setShadowed(false));
|
|
39
|
-
|
|
40
|
-
const buildSection = (section, index) => {
|
|
37
|
+
const onMenuOpen = (0, _react.useCallback)(() => setShadowed(true), []);
|
|
38
|
+
const onMenuClose = (0, _react.useCallback)(() => setShadowed(false), []);
|
|
39
|
+
const buildSection = (0, _react.useCallback)((section, index) => {
|
|
41
40
|
return /*#__PURE__*/_react.default.createElement(_cardsList.default, _extends({}, section, {
|
|
42
41
|
key: section.title + index
|
|
43
42
|
}));
|
|
44
|
-
};
|
|
45
|
-
|
|
43
|
+
}, []);
|
|
46
44
|
const sectionsList = (0, _react.useMemo)(() => _map2.default.convert({
|
|
47
45
|
cap: false
|
|
48
46
|
})(buildSection, sections), [buildSection, sections]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/template/teams-dashboard/index.js"],"names":["TeamsDashboard","logo","platformLinks","sections","isLoading","isShadowed","setShadowed","onMenuOpen","onMenuClose","buildSection","section","index","title","sectionsList","convert","cap","style","loader","shadowedTeamsDashboard","teamsDashboard","sectionsWrapper","propTypes","MoocHeader","PropTypes","arrayOf","shape","Cta","CardsList","bool"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,aAAP;AAAsBC,EAAAA,QAAtB;AAAgCC,EAAAA;AAAhC,CAAD,KAAgD;AACrE,QAAM,CAACC,UAAD,EAAaC,WAAb,IAA4B,qBAAS,KAAT,CAAlC;AACA,QAAMC,UAAU,GAAG,wBAAY,MAAMD,WAAW,CAAC,IAAD,CAA7B,CAAnB;AACA,QAAME,WAAW,GAAG,wBAAY,MAAMF,WAAW,CAAC,KAAD,CAA7B,CAApB
|
|
1
|
+
{"version":3,"sources":["../../../src/template/teams-dashboard/index.js"],"names":["TeamsDashboard","logo","platformLinks","sections","isLoading","isShadowed","setShadowed","onMenuOpen","onMenuClose","buildSection","section","index","title","sectionsList","convert","cap","style","loader","shadowedTeamsDashboard","teamsDashboard","sectionsWrapper","propTypes","MoocHeader","PropTypes","arrayOf","shape","Cta","CardsList","bool"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,aAAP;AAAsBC,EAAAA,QAAtB;AAAgCC,EAAAA;AAAhC,CAAD,KAAgD;AACrE,QAAM,CAACC,UAAD,EAAaC,WAAb,IAA4B,qBAAS,KAAT,CAAlC;AACA,QAAM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BC,aAAIL,SAApB,CAAlB,CAFU;AAGzBlB,EAAAA,QAAQ,EAAEoB,mBAAUC,OAAV,CAAkBD,mBAAUE,KAAV,CAAgBE,mBAAUN,SAA1B,CAAlB,CAHe;AAIzBjB,EAAAA,SAAS,EAAEmB,mBAAUK;AAJI,CAA3B;eAOe5B,c","sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport MoocHeader from '../../organism/mooc-header';\nimport Cta from '../../atom/cta';\nimport Loader from '../../atom/loader';\nimport CardsList from '../../molecule/dashboard/cards-list';\nimport style from './style.css';\n\nconst TeamsDashboard = ({logo, platformLinks, sections, isLoading}) => {\n const [isShadowed, setShadowed] = useState(false);\n const onMenuOpen = useCallback(() => setShadowed(true), []);\n const onMenuClose = useCallback(() => setShadowed(false), []);\n\n const buildSection = useCallback((section, index) => {\n return <CardsList {...section} key={section.title + index} />;\n }, []);\n\n const sectionsList = useMemo(() => map.convert({cap: false})(buildSection, sections), [\n buildSection,\n sections\n ]);\n\n return isLoading ? (\n <div className={style.loader}>\n <Loader data-name=\"teams-dashboard-loader\" />\n </div>\n ) : (\n <div\n data-name=\"teams-dashboard\"\n className={isShadowed ? style.shadowedTeamsDashboard : style.teamsDashboard}\n >\n <MoocHeader\n data-name=\"teams-dashboard-header\"\n logo={logo}\n links={platformLinks}\n onMenuOpen={onMenuOpen}\n onMenuClose={onMenuClose}\n />\n <div data-name=\"sections-wrapper\" className={isShadowed ? style.sectionsWrapper : null}>\n {sectionsList}\n </div>\n </div>\n );\n};\n\nTeamsDashboard.propTypes = {\n logo: MoocHeader.propTypes.logo,\n platformLinks: PropTypes.arrayOf(PropTypes.shape(Cta.propTypes)),\n sections: PropTypes.arrayOf(PropTypes.shape(CardsList.propTypes)),\n isLoading: PropTypes.bool\n};\n\nexport default TeamsDashboard;\n"],"file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"classnames": "^2.2.6",
|
|
56
56
|
"css-color-function": "^1.3.3",
|
|
57
57
|
"cubic-bezier": "^0.1.2",
|
|
58
|
+
"eslint-plugin-react-hooks": "^4.3.0",
|
|
58
59
|
"extended-proptypes": "^1.3.0",
|
|
59
60
|
"hammerjs": "^2.0.8",
|
|
60
61
|
"lodash": "^4.17.15",
|
|
@@ -118,5 +119,5 @@
|
|
|
118
119
|
"webpack-hot-middleware": "^2.25.0"
|
|
119
120
|
},
|
|
120
121
|
"author": "CoorpAcademy",
|
|
121
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "d8221337ef92da87cecddf4eaae1fb82c436b1b5"
|
|
122
123
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
-
import MoleculeShortLivedBanner from '..';
|
|
5
|
-
import fixtureErrorBanner from './fixtures/error-banner';
|
|
6
|
-
import fixtureSuccessBanner from './fixtures/success-banner';
|
|
7
|
-
test('Molecule › MoleculeShortLivedBanner > should have valid propTypes', t => {
|
|
8
|
-
t.pass();
|
|
9
|
-
forEach(MoleculeShortLivedBanner.propTypes, (value, key) => {
|
|
10
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeShortLivedBanner.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
test('Molecule › MoleculeShortLivedBanner › ErrorBanner › should be rendered', renderComponentMacro, MoleculeShortLivedBanner, fixtureErrorBanner);
|
|
14
|
-
test('Molecule › MoleculeShortLivedBanner › SuccessBanner › should be rendered', renderComponentMacro, MoleculeShortLivedBanner, fixtureSuccessBanner);
|
|
15
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/short-lived-banner/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeShortLivedBanner","fixtureErrorBanner","fixtureSuccessBanner","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,wBAAP,MAAqC,IAArC;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AAEAL,IAAI,CAAC,mEAAD,EAAsEM,CAAC,IAAI;AAC7EA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,wBAAwB,CAACK,SAA1B,EAAqC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC1DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,6DAA4DF,GAAI,mEAAzF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,wEAAD,EAA2EE,oBAA3E,EAAiGC,wBAAjG,EAA2HC,kBAA3H,CAAJ;AACAJ,IAAI,CAAC,0EAAD,EAA6EE,oBAA7E,EAAmGC,wBAAnG,EAA6HE,oBAA7H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeShortLivedBanner from '..';\nimport fixtureErrorBanner from './fixtures/error-banner';\nimport fixtureSuccessBanner from './fixtures/success-banner';\n\ntest('Molecule › MoleculeShortLivedBanner > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeShortLivedBanner.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeShortLivedBanner.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeShortLivedBanner › ErrorBanner › should be rendered', renderComponentMacro, MoleculeShortLivedBanner, fixtureErrorBanner);\ntest('Molecule › MoleculeShortLivedBanner › SuccessBanner › should be rendered', renderComponentMacro, MoleculeShortLivedBanner, fixtureSuccessBanner);\n"],"file":"fixtures.js"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _errorBanner = _interopRequireDefault(require("./fixtures/error-banner"));
|
|
12
|
-
|
|
13
|
-
var _successBanner = _interopRequireDefault(require("./fixtures/success-banner"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
(0, _ava.default)('Molecule › MoleculeShortLivedBanner > should have valid propTypes', t => {
|
|
18
|
-
t.pass();
|
|
19
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeShortLivedBanner.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
(0, _ava.default)('Molecule › MoleculeShortLivedBanner › ErrorBanner › should be rendered', _renderComponent.default, _.default, _errorBanner.default);
|
|
24
|
-
(0, _ava.default)('Molecule › MoleculeShortLivedBanner › SuccessBanner › should be rendered', _renderComponent.default, _.default, _successBanner.default);
|
|
25
|
-
//# sourceMappingURL=fixtures.js.map
|