@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
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
+
var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
|
|
7
|
+
|
|
6
8
|
var _react = _interopRequireDefault(require("react"));
|
|
7
9
|
|
|
8
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -17,6 +19,12 @@ var _style = _interopRequireDefault(require("./style.css"));
|
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
22
|
+
const ICONS = {
|
|
23
|
+
success: _novaIcons.NovaCompositionCoorpacademyValidate,
|
|
24
|
+
error: _novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond,
|
|
25
|
+
warning: _novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond
|
|
26
|
+
};
|
|
27
|
+
|
|
20
28
|
const Banner = props => {
|
|
21
29
|
const {
|
|
22
30
|
type,
|
|
@@ -24,16 +32,18 @@ const Banner = props => {
|
|
|
24
32
|
firstCTA,
|
|
25
33
|
firstCTALabel,
|
|
26
34
|
secondCTALabel,
|
|
27
|
-
secondCTA
|
|
35
|
+
secondCTA,
|
|
36
|
+
temporary
|
|
28
37
|
} = props;
|
|
38
|
+
const Icon = ICONS[type];
|
|
29
39
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
-
className: (0, _classnames.default)(_style.default.banner, type === 'error' && _style.default.errorBanner),
|
|
40
|
+
className: (0, _classnames.default)(_style.default.banner, type === 'error' && _style.default.errorBanner, type === 'success' && _style.default.successBanner, temporary && _style.default.temporaryBanner),
|
|
31
41
|
title: message
|
|
32
42
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
33
43
|
"data-name": `${type}-banner-message`,
|
|
34
44
|
className: _style.default.message
|
|
35
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
36
|
-
className: _style.default.icon
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
46
|
+
className: (0, _classnames.default)(_style.default.icon, temporary && _style.default.temporaryIcon)
|
|
37
47
|
}), message), firstCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
|
|
38
48
|
className: _style.default.button
|
|
39
49
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
@@ -56,12 +66,13 @@ const Banner = props => {
|
|
|
56
66
|
};
|
|
57
67
|
|
|
58
68
|
Banner.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
59
|
-
type: _propTypes.default.oneOf(
|
|
69
|
+
type: _propTypes.default.oneOf((0, _keys2.default)(ICONS)),
|
|
60
70
|
message: _propTypes.default.string.isRequired,
|
|
61
71
|
firstCTA: _propTypes.default.func,
|
|
62
72
|
firstCTALabel: _propTypes.default.string,
|
|
63
73
|
secondCTALabel: _propTypes.default.string,
|
|
64
|
-
secondCTA: _propTypes.default.func
|
|
74
|
+
secondCTA: _propTypes.default.func,
|
|
75
|
+
temporary: _propTypes.default.bool
|
|
65
76
|
} : {};
|
|
66
77
|
var _default = Banner;
|
|
67
78
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/banner/index.js"],"names":["Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","style","banner","errorBanner","icon","button","buttonsBar","propTypes","PropTypes","oneOf","string","isRequired","func"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/banner/index.js"],"names":["ICONS","success","ValidateIcon","error","QuestionIcon","warning","Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","temporary","Icon","style","banner","errorBanner","successBanner","temporaryBanner","icon","temporaryIcon","button","buttonsBar","propTypes","PropTypes","oneOf","string","isRequired","func","bool"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;;;AAEA,MAAMA,KAAK,GAAG;AACZC,EAAAA,OAAO,EAAEC,8CADG;AAEZC,EAAAA,KAAK,EAAEC,0DAFK;AAGZC,EAAAA,OAAO,EAAED;AAHG,CAAd;;AAMA,MAAME,MAAM,GAAGC,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CADa,GAUX,IAnCN,CADF;AAuCD,CA1CD;;AA4CAN,MAAM,CAACmB,SAAP,2CAAmB;AACjBjB,EAAAA,IAAI,EAAEkB,mBAAUC,KAAV,CAAgB,oBAAK3B,KAAL,CAAhB,CADW;AAEjBS,EAAAA,OAAO,EAAEiB,mBAAUE,MAAV,CAAiBC,UAFT;AAGjBnB,EAAAA,QAAQ,EAAEgB,mBAAUI,IAHH;AAIjBnB,EAAAA,aAAa,EAAEe,mBAAUE,MAJR;AAKjBhB,EAAAA,cAAc,EAAEc,mBAAUE,MALT;AAMjBf,EAAAA,SAAS,EAAEa,mBAAUI,IANJ;AAOjBhB,EAAAA,SAAS,EAAEY,mBAAUK;AAPJ,CAAnB;eAUezB,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon,\n NovaCompositionCoorpacademyValidate as ValidateIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/button-link';\nimport style from './style.css';\n\nconst ICONS = {\n success: ValidateIcon,\n error: QuestionIcon,\n warning: QuestionIcon\n};\n\nconst Banner = props => {\n const {type, message, firstCTA, firstCTALabel, secondCTALabel, secondCTA, temporary} = props;\n const Icon = ICONS[type];\n return (\n <div\n className={classnames(\n style.banner,\n type === 'error' && style.errorBanner,\n type === 'success' && style.successBanner,\n temporary && style.temporaryBanner\n )}\n title={message}\n >\n <div data-name={`${type}-banner-message`} className={style.message}>\n <Icon className={classnames(style.icon, temporary && style.temporaryIcon)} />\n {message}\n </div>\n {firstCTALabel ? (\n <div className={style.button}>\n <Link\n data-name=\"first-banner-cta\"\n aria-label={firstCTALabel}\n label={firstCTALabel}\n onClick={firstCTA}\n type=\"text\"\n />\n </div>\n ) : null}\n {firstCTALabel && secondCTALabel ? <div className={style.buttonsBar} /> : null}\n {secondCTALabel ? (\n <div className={style.button}>\n <Link\n data-name=\"second-banner-cta\"\n onClick={secondCTA}\n aria-label={secondCTALabel}\n label={secondCTALabel}\n type=\"text\"\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nBanner.propTypes = {\n type: PropTypes.oneOf(keys(ICONS)),\n message: PropTypes.string.isRequired,\n firstCTA: PropTypes.func,\n firstCTALabel: PropTypes.string,\n secondCTALabel: PropTypes.string,\n secondCTA: PropTypes.func,\n temporary: PropTypes.bool\n};\n\nexport default Banner;\n"],"file":"index.js"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@value colors: "../../variables/colors.css";
|
|
4
4
|
@value white from colors;
|
|
5
5
|
@value medium from colors;
|
|
6
|
+
@value cm_positive_100 from colors;
|
|
6
7
|
@value cm_negative_50 from colors;
|
|
7
8
|
@value cm_negative_200 from colors;
|
|
8
9
|
@value cm_warning_50 from colors;
|
|
@@ -10,6 +11,23 @@
|
|
|
10
11
|
@value cm_yellow_200 from colors;
|
|
11
12
|
@value cm_yellow_400 from colors;
|
|
12
13
|
|
|
14
|
+
@keyframes fadeIn {
|
|
15
|
+
0% {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
margin-top: -50px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
16% {
|
|
21
|
+
margin-top: 70px;
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
100% {
|
|
26
|
+
margin-top: 70px;
|
|
27
|
+
opacity: 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
13
31
|
.banner {
|
|
14
32
|
display: flex;
|
|
15
33
|
flex-direction: row;
|
|
@@ -27,6 +45,29 @@
|
|
|
27
45
|
background-color: cm_negative_50;
|
|
28
46
|
color: cm_negative_200;
|
|
29
47
|
}
|
|
48
|
+
.successBanner {
|
|
49
|
+
background-color: color(cm_positive_100 a(15%));
|
|
50
|
+
color: cm_positive_100;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.temporaryBanner {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
padding: 16px 24px;
|
|
57
|
+
border-radius: 5px;
|
|
58
|
+
border-radius: 5px;
|
|
59
|
+
animation: fadeIn 1800ms;
|
|
60
|
+
animation-direction: alternate;
|
|
61
|
+
animation-iteration-count: 2;
|
|
62
|
+
animation-fill-mode: both;
|
|
63
|
+
animation-timing-function: ease-in;
|
|
64
|
+
z-index: 10000;
|
|
65
|
+
position: fixed;
|
|
66
|
+
top: 0;
|
|
67
|
+
left: 50%;
|
|
68
|
+
transform: translateX(-50%);
|
|
69
|
+
|
|
70
|
+
}
|
|
30
71
|
|
|
31
72
|
.button{
|
|
32
73
|
background-color: transparent;
|
|
@@ -50,6 +91,12 @@
|
|
|
50
91
|
margin-right: 16px;
|
|
51
92
|
}
|
|
52
93
|
|
|
94
|
+
.temporaryIcon {
|
|
95
|
+
width: 16px;
|
|
96
|
+
height: 16px;
|
|
97
|
+
margin-right: 8px;
|
|
98
|
+
}
|
|
99
|
+
|
|
53
100
|
.message {
|
|
54
101
|
font-family: 'Gilroy';
|
|
55
102
|
font-size: 14px;
|
|
@@ -4,7 +4,7 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
var _default = {
|
|
6
6
|
props: {
|
|
7
|
-
type: '
|
|
7
|
+
type: 'warning',
|
|
8
8
|
message: 'Changes saved but not published. Do you want to update this custom playlist now? ',
|
|
9
9
|
firstCTALabel: 'Undo',
|
|
10
10
|
firstCTA: () => console.log('first cta'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/banner/test/fixtures/default.js"],"names":["props","type","message","firstCTALabel","firstCTA","console","log","secondCTALabel","secondCTA"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/banner/test/fixtures/default.js"],"names":["props","type","message","firstCTALabel","firstCTA","console","log","secondCTALabel","secondCTA"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAELC,IAAAA,OAAO,EAAE,mFAFJ;AAGLC,IAAAA,aAAa,EAAE,MAHV;AAILC,IAAAA,QAAQ,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,WAAZ,CAJX;AAKLC,IAAAA,cAAc,EAAE,QALX;AAMLC,IAAAA,SAAS,EAAE,MAAMH,OAAO,CAACC,GAAR,CAAY,YAAZ;AANZ;AADM,C","sourcesContent":["export default {\n props: {\n type: 'warning',\n message: 'Changes saved but not published. Do you want to update this custom playlist now? ',\n firstCTALabel: 'Undo',\n firstCTA: () => console.log('first cta'),\n secondCTALabel: 'Update',\n secondCTA: () => console.log('second cta')\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
type: 'error',
|
|
8
|
+
message: 'There was an error while publishing the custom playlist. Please Try again. ',
|
|
9
|
+
temporary: true
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.default = _default;
|
|
13
|
+
//# sourceMappingURL=error-temporary-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/banner/test/fixtures/error-temporary-banner.js"],"names":["props","type","message","temporary"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,OADD;AAELC,IAAAA,OAAO,EAAE,6EAFJ;AAGLC,IAAAA,SAAS,EAAE;AAHN;AADM,C","sourcesContent":["export default {\n props: {\n type: 'error',\n message: 'There was an error while publishing the custom playlist. Please Try again. ',\n temporary: true\n }\n};\n"],"file":"error-temporary-banner.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
type: 'success',
|
|
8
|
+
message: 'Custom playlist successfully published '
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
exports.default = _default;
|
|
12
|
+
//# sourceMappingURL=success-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/banner/test/fixtures/success-banner.js"],"names":["props","type","message"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAELC,IAAAA,OAAO,EAAE;AAFJ;AADM,C","sourcesContent":["export default {\n props: {\n type: 'success',\n message: 'Custom playlist successfully published '\n }\n};\n"],"file":"success-banner.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
type: 'success',
|
|
8
|
+
message: 'Custom playlist successfully published ',
|
|
9
|
+
temporary: true
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.default = _default;
|
|
13
|
+
//# sourceMappingURL=success-temporary-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/banner/test/fixtures/success-temporary-banner.js"],"names":["props","type","message","temporary"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAELC,IAAAA,OAAO,EAAE,yCAFJ;AAGLC,IAAAA,SAAS,EAAE;AAHN;AADM,C","sourcesContent":["export default {\n props: {\n type: 'success',\n message: 'Custom playlist successfully published ',\n temporary: true\n }\n};\n"],"file":"success-temporary-banner.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
type: 'warning',
|
|
8
|
+
message: 'Custom playlist successfully published ',
|
|
9
|
+
temporary: true
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.default = _default;
|
|
13
|
+
//# sourceMappingURL=warning-temporary-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/banner/test/fixtures/warning-temporary-banner.js"],"names":["props","type","message","temporary"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAELC,IAAAA,OAAO,EAAE,yCAFJ;AAGLC,IAAAA,SAAS,EAAE;AAHN;AADM,C","sourcesContent":["export default {\n props: {\n type: 'warning',\n message: 'Custom playlist successfully published ',\n temporary: true\n }\n};\n"],"file":"warning-temporary-banner.js"}
|
|
@@ -14,8 +14,12 @@ var _errorBanner = _interopRequireDefault(require("./fixtures/error-banner"));
|
|
|
14
14
|
|
|
15
15
|
var _errorTemporaryBanner = _interopRequireDefault(require("./fixtures/error-temporary-banner"));
|
|
16
16
|
|
|
17
|
+
var _successBanner = _interopRequireDefault(require("./fixtures/success-banner"));
|
|
18
|
+
|
|
17
19
|
var _successTemporaryBanner = _interopRequireDefault(require("./fixtures/success-temporary-banner"));
|
|
18
20
|
|
|
21
|
+
var _warningTemporaryBanner = _interopRequireDefault(require("./fixtures/warning-temporary-banner"));
|
|
22
|
+
|
|
19
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
24
|
|
|
21
25
|
(0, _ava.default)('Molecule › MoleculeBanner > should have valid propTypes', t => {
|
|
@@ -27,5 +31,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
31
|
(0, _ava.default)('Molecule › MoleculeBanner › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
28
32
|
(0, _ava.default)('Molecule › MoleculeBanner › ErrorBanner › should be rendered', _renderComponent.default, _.default, _errorBanner.default);
|
|
29
33
|
(0, _ava.default)('Molecule › MoleculeBanner › ErrorTemporaryBanner › should be rendered', _renderComponent.default, _.default, _errorTemporaryBanner.default);
|
|
34
|
+
(0, _ava.default)('Molecule › MoleculeBanner › SuccessBanner › should be rendered', _renderComponent.default, _.default, _successBanner.default);
|
|
30
35
|
(0, _ava.default)('Molecule › MoleculeBanner › SuccessTemporaryBanner › should be rendered', _renderComponent.default, _.default, _successTemporaryBanner.default);
|
|
36
|
+
(0, _ava.default)('Molecule › MoleculeBanner › WarningTemporaryBanner › should be rendered', _renderComponent.default, _.default, _warningTemporaryBanner.default);
|
|
31
37
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/banner/test/fixtures.js"],"names":["t","pass","MoleculeBanner","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureErrorBanner","fixtureErrorTemporaryBanner","fixtureSuccessTemporaryBanner"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,yDAAL,EAAgEA,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAeC,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,0DAAL,EAAiEG,wBAAjE,EAAuFN,SAAvF,EAAuGO,gBAAvG;AACA,kBAAK,8DAAL,EAAqED,wBAArE,EAA2FN,SAA3F,EAA2GQ,oBAA3G;AACA,kBAAK,uEAAL,EAA8EF,wBAA9E,EAAoGN,SAApG,EAAoHS,6BAApH;AACA,kBAAK,yEAAL,
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/banner/test/fixtures.js"],"names":["t","pass","MoleculeBanner","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureErrorBanner","fixtureErrorTemporaryBanner","fixtureSuccessBanner","fixtureSuccessTemporaryBanner","fixtureWarningTemporaryBanner"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,yDAAL,EAAgEA,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAeC,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,0DAAL,EAAiEG,wBAAjE,EAAuFN,SAAvF,EAAuGO,gBAAvG;AACA,kBAAK,8DAAL,EAAqED,wBAArE,EAA2FN,SAA3F,EAA2GQ,oBAA3G;AACA,kBAAK,uEAAL,EAA8EF,wBAA9E,EAAoGN,SAApG,EAAoHS,6BAApH;AACA,kBAAK,gEAAL,EAAuEH,wBAAvE,EAA6FN,SAA7F,EAA6GU,sBAA7G;AACA,kBAAK,yEAAL,EAAgFJ,wBAAhF,EAAsGN,SAAtG,EAAsHW,+BAAtH;AACA,kBAAK,yEAAL,EAAgFL,wBAAhF,EAAsGN,SAAtG,EAAsHY,+BAAtH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeBanner from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureErrorBanner from './fixtures/error-banner';\nimport fixtureErrorTemporaryBanner from './fixtures/error-temporary-banner';\nimport fixtureSuccessBanner from './fixtures/success-banner';\nimport fixtureSuccessTemporaryBanner from './fixtures/success-temporary-banner';\nimport fixtureWarningTemporaryBanner from './fixtures/warning-temporary-banner';\n\ntest('Molecule › MoleculeBanner > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeBanner.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeBanner.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeBanner › Default › should be rendered', renderComponentMacro, MoleculeBanner, fixtureDefault);\ntest('Molecule › MoleculeBanner › ErrorBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureErrorBanner);\ntest('Molecule › MoleculeBanner › ErrorTemporaryBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureErrorTemporaryBanner);\ntest('Molecule › MoleculeBanner › SuccessBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureSuccessBanner);\ntest('Molecule › MoleculeBanner › SuccessTemporaryBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureSuccessTemporaryBanner);\ntest('Molecule › MoleculeBanner › WarningTemporaryBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureWarningTemporaryBanner);\n"],"file":"fixtures.js"}
|
|
@@ -39,7 +39,10 @@ const BrandCreateForm = (props, context) => {
|
|
|
39
39
|
const wrapperClass = isModified || isPending || field.error ? _style.default.modifiedWrapper : _style.default.wrapper;
|
|
40
40
|
const fieldClass = field.error ? _style.default.error : _style.default.default;
|
|
41
41
|
const disabled = isPending || !isModified;
|
|
42
|
-
const
|
|
42
|
+
const {
|
|
43
|
+
onChange
|
|
44
|
+
} = field;
|
|
45
|
+
const handleChange = (0, _react.useMemo)(() => e => onChange(e.target.value), [onChange]);
|
|
43
46
|
const actionView = isPending ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
44
47
|
className: _style.default.wait
|
|
45
48
|
}, waitMessage), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/brand-create-form/index.js"],"names":["BrandCreateForm","props","context","title","subtitle","description","field","onSubmit","submitValue","isPending","isModified","translate","waitMessage","wrapperClass","error","style","modifiedWrapper","wrapper","fieldClass","default","disabled","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/brand-create-form/index.js"],"names":["BrandCreateForm","props","context","title","subtitle","description","field","onSubmit","submitValue","isPending","isModified","translate","waitMessage","wrapperClass","error","style","modifiedWrapper","wrapper","fieldClass","default","disabled","onChange","handleChange","e","target","value","actionView","wait","loading","header","content","placeholder","label","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","func","bool"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,eAAe,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AAC1C,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,QAAR;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA,KAA/B;AAAsCC,IAAAA,QAAtC;AAAgDC,IAAAA,WAAhD;AAA6DC,IAAAA,SAA7D;AAAwEC,IAAAA;AAAxE,MAAsFT,KAA5F;AACA,QAAM;AAACU,IAAAA;AAAD,MAAcT,OAApB;AACA,QAAMU,WAAW,GAAGD,SAAS,CAAC,eAAD,CAA7B;AAEA,QAAME,YAAY,GAChBH,UAAU,IAAID,SAAd,IAA2BH,KAAK,CAACQ,KAAjC,GAAyCC,eAAMC,eAA/C,GAAiED,eAAME,OADzE;AAEA,QAAMC,UAAU,GAAGZ,KAAK,CAACQ,KAAN,GAAcC,eAAMD,KAApB,GAA4BC,eAAMI,OAArD;AACA,QAAMC,QAAQ,GAAGX,SAAS,IAAI,CAACC,UAA/B;AACA,QAAM;AAACW,IAAAA;AAAD,MAAaf,KAAnB;AACA,QAAMgB,YAAY,GAAG,oBAAQ,MAAMC,CAAC,IAAIF,QAAQ,CAACE,CAAC,CAACC,MAAF,CAASC,KAAV,CAA3B,EAA6C,CAACJ,QAAD,CAA7C,CAArB;AAEA,QAAMK,UAAU,GAAGjB,SAAS,gBAC1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I1BjC,EAAAA,KAAK,EAAE+B,mBAAUG,KAAV,CAAgB;AACrBT,IAAAA,WAAW,EAAEM,mBAAUC,MAAV,CAAiBC,UADT;AAErBP,IAAAA,KAAK,EAAEK,mBAAUC,MAAV,CAAiBC,UAFH;AAGrBlB,IAAAA,QAAQ,EAAEgB,mBAAUI,IAAV,CAAeF,UAHJ;AAIrBzB,IAAAA,KAAK,EAAEuB,mBAAUC,MAJI;AAKrBb,IAAAA,KAAK,EAAEY,mBAAUC;AALI,GAAhB,EAMJC,UAVuB;AAW1BhC,EAAAA,QAAQ,EAAE8B,mBAAUI,IAAV,CAAeF,UAXC;AAY1B/B,EAAAA,WAAW,EAAE6B,mBAAUC,MAAV,CAAiBC,UAZJ;AAa1B9B,EAAAA,SAAS,EAAE4B,mBAAUK,IAbK;AAc1BhC,EAAAA,UAAU,EAAE2B,mBAAUK;AAdI,CAA5B;eAiBe1C,e","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '../../atom/button';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst BrandCreateForm = (props, context) => {\n const {title, subtitle, description, field, onSubmit, submitValue, isPending, isModified} = props;\n const {translate} = context;\n const waitMessage = translate('Wait_creation');\n\n const wrapperClass =\n isModified || isPending || field.error ? style.modifiedWrapper : style.wrapper;\n const fieldClass = field.error ? style.error : style.default;\n const disabled = isPending || !isModified;\n const {onChange} = field;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const actionView = isPending ? (\n <div>\n <div className={style.wait}>{waitMessage}</div>\n <div className={style.loading}>\n <Loader />\n </div>\n </div>\n ) : (\n <div>\n <Button\n data-name=\"brand_create_submit_button\"\n type=\"submit\"\n disabled={disabled}\n submitValue={submitValue}\n />\n </div>\n );\n\n return (\n <div className={wrapperClass}>\n <div className={style.header}>\n <h1>{title}</h1>\n </div>\n <form className={style.content} onSubmit={onSubmit}>\n <h2>{subtitle}</h2>\n <div className={style.description}>{description}</div>\n <div className={fieldClass}>\n <label>\n <input\n type=\"text\"\n data-name=\"brand_create_text_input\"\n placeholder={field.placeholder}\n defaultValue={field.value}\n onInput={handleChange}\n />\n {field.label}\n </label>\n </div>\n {actionView}\n </form>\n </div>\n );\n};\n\nBrandCreateForm.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nBrandCreateForm.propTypes = {\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n field: PropTypes.shape({\n placeholder: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n error: PropTypes.string,\n value: PropTypes.string\n }).isRequired,\n onSubmit: PropTypes.func.isRequired,\n submitValue: PropTypes.string.isRequired,\n isPending: PropTypes.bool,\n isModified: PropTypes.bool\n};\n\nexport default BrandCreateForm;\n"],"file":"index.js"}
|
|
@@ -19,8 +19,6 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
22
|
const BulletPointMenuButton = props => {
|
|
25
23
|
const {
|
|
26
24
|
disabled = false,
|
|
@@ -52,9 +50,7 @@ const BulletPointMenuButton = props => {
|
|
|
52
50
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
51
|
className: _style.default.bulletPointWrapper,
|
|
54
52
|
"data-name": "bullet-point-wrapper"
|
|
55
|
-
}, /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default,
|
|
56
|
-
className: _style.default.bulletPointButton
|
|
57
|
-
})), menu);
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default, bulletPointButtonProps), menu);
|
|
58
54
|
};
|
|
59
55
|
|
|
60
56
|
BulletPointMenuButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/bullet-point-menu-button/index.js"],"names":["BulletPointMenuButton","props","disabled","buttonAriaLabel","menuAriaLabel","onClick","buttons","handleOnClick","menuProps","menu","style","bulletPointMenu","bulletPointButtonProps","size","icon","bulletPointWrapper","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/bullet-point-menu-button/index.js"],"names":["BulletPointMenuButton","props","disabled","buttonAriaLabel","menuAriaLabel","onClick","buttons","handleOnClick","menuProps","menu","style","bulletPointMenu","bulletPointButtonProps","size","icon","bulletPointWrapper","propTypes","PropTypes","bool","string","ButtonMenu","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,qBAAqB,GAAGC,KAAK,IAAI;AACrC,QAAM;AAACC,IAAAA,QAAQ,GAAG,KAAZ;AAAmBC,IAAAA,eAAnB;AAAoCC,IAAAA,aAApC;AAAmDC,IAAAA,OAAnD;AAA4DC,IAAAA;AAA5D,MAAuEL,KAA7E;AACA,QAAMM,aAAa,GAAG,wBAAY,MAAMF,OAAO,EAAzB,EAA6B,CAACA,OAAD,CAA7B,CAAtB;AAEA,QAAMG,SAAS,GAAG;AAChB,iBAAa,aADG;AAEhBF,IAAAA;AAFgB,GAAlB;;AAKA,QAAMG,IAAI,gBACR;AAAK,IAAA,SAAS,EAAEC,eAAMC,eAAtB;AAAuC,iBAAU,cAAjD;AAAgE,kBAAYP;AAA5E,kBACE,6BAAC,mBAAD,EAAgBI,SAAhB,CADF,CADF;;AAKA,QAAMI,sBAAsB,GAAG;AAC7BC,IAAAA,IAAI,EAAE,SADuB;AAE7B,kBAAcV,eAFe;AAG7B,iBAAa,qBAHgB;AAI7BW,IAAAA,IAAI,EAAE,cAJuB;AAK7BT,IAAAA,OAAO,EAAEE,aALoB;AAM7BL,IAAAA;AAN6B,GAA/B;AASA,sBACE;AAAK,IAAA,SAAS,EAAEQ,eAAMK,kBAAtB;AAA0C,iBAAU;AAApD,kBACE,6BAAC,2BAAD,EAAwBH,sBAAxB,CADF,EAEGH,IAFH,CADF;AAMD,CA7BD;;AA+BAT,qBAAqB,CAACgB,SAAtB,2CAAkC;AAChCd,EAAAA,QAAQ,EAAEe,mBAAUC,IADY;AAEhCf,EAAAA,eAAe,EAAEc,mBAAUE,MAFK;AAGhCf,EAAAA,aAAa,EAAEa,mBAAUE,MAHO;AAIhCb,EAAAA,OAAO,EAAEc,oBAAWJ,SAAX,CAAqBV,OAJE;AAKhCD,EAAAA,OAAO,EAAEY,mBAAUI;AALa,CAAlC;eAQerB,qB","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ButtonMenu from '../../atom/button-menu';\nimport style from './style.css';\n\nconst BulletPointMenuButton = props => {\n const {disabled = false, buttonAriaLabel, menuAriaLabel, onClick, buttons} = props;\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const menuProps = {\n 'data-name': 'button-menu',\n buttons\n };\n\n const menu = (\n <div className={style.bulletPointMenu} data-name=\"menu-wrapper\" aria-label={menuAriaLabel}>\n <ButtonMenu {...menuProps} />\n </div>\n );\n const bulletPointButtonProps = {\n size: 'default',\n 'aria-label': buttonAriaLabel,\n 'data-name': 'bullet-point-button',\n icon: 'bullet-point',\n onClick: handleOnClick,\n disabled\n };\n\n return (\n <div className={style.bulletPointWrapper} data-name=\"bullet-point-wrapper\">\n <ButtonLinkIconOnly {...bulletPointButtonProps} />\n {menu}\n </div>\n );\n};\n\nBulletPointMenuButton.propTypes = {\n disabled: PropTypes.bool,\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: ButtonMenu.propTypes.buttons,\n onClick: PropTypes.func\n};\n\nexport default BulletPointMenuButton;\n"],"file":"index.js"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
position: relative;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.
|
|
13
|
+
.bulletPointWrapper > button {
|
|
14
14
|
position: relative;
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
}
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
background-color: cm_grey_100;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
/* Fade-in - Fade-out */
|
|
35
|
-
|
|
34
|
+
/* Fade-in - Fade-out, does target button class but bulletPointMenu only */
|
|
35
|
+
button + .bulletPointMenu {
|
|
36
36
|
max-height: 0;
|
|
37
37
|
/* fade out combo */
|
|
38
38
|
visibility: hidden;
|
|
@@ -40,13 +40,17 @@
|
|
|
40
40
|
transition:visibility 0.5s ease,opacity 0.5s ease;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
/* Does target button class but bulletPointMenu only */
|
|
44
|
+
button:focus + .bulletPointMenu {
|
|
44
45
|
/* fade in combo */
|
|
45
46
|
max-height: max-content;
|
|
46
47
|
visibility:visible;
|
|
47
48
|
opacity:1;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
/*
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
/*
|
|
52
|
+
Recover - unset pointer-events,
|
|
53
|
+
to be able to click on the button when the menu is open to close it
|
|
54
|
+
*/
|
|
55
|
+
.bulletPointWrapper > button:focus { pointer-events: none; }
|
|
56
|
+
.bulletPointWrapper > button:not(:focus) { pointer-events: auto; }
|
|
@@ -150,7 +150,7 @@ const Card = (0, _react.memo)(function Card(props, context) {
|
|
|
150
150
|
const primaryColor = (0, _get2.default)('common.primary', skin);
|
|
151
151
|
const whiteColor = (0, _get2.default)('common.white', skin);
|
|
152
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);
|
|
153
|
-
const handleClick = (0, _react.useMemo)(() => e => !disabled && onClick(e), [onClick]);
|
|
153
|
+
const handleClick = (0, _react.useMemo)(() => e => !disabled && onClick(e), [disabled, onClick]);
|
|
154
154
|
const lock = disabled ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidLoginLocked, {
|
|
155
155
|
className: _style.default.lockIcon,
|
|
156
156
|
color: whiteColor,
|
|
@@ -1 +1 @@
|
|
|
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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EjB,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;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), [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"}
|
|
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,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,EAAEC,eAAMC;AAAtB,oBACE,6BAAC,QAAD;AAAU,MAAA,SAAS,EAAED,eAAME;AAA3B,MADF,CADF;;AAMA,QAAId,KAAJ,EAAW;AACT,YAAMe,eAAe,gBACnB;AACE,Q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,EAAAA,QAAQ,EAAER,mBAAUE,IAHL;AAIfK,EAAAA,OAAO,EAAEP,mBAAUE,IAJJ;AAKfhC,EAAAA,IAAI,EAAE8B,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;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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
+
|
|
13
|
+
var _loading = _interopRequireDefault(require("./fixtures/loading"));
|
|
14
|
+
|
|
15
|
+
var _videoTranslate = _interopRequireDefault(require("./fixtures/video-translate"));
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
|
|
19
|
+
(0, _ava.default)('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {
|
|
20
|
+
t.pass();
|
|
21
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
22
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeCockpitPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
(0, _ava.default)('Molecule › MoleculeCockpitPopin › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
26
|
+
(0, _ava.default)('Molecule › MoleculeCockpitPopin › Loading › should be rendered', _renderComponent.default, _.default, _loading.default);
|
|
27
|
+
(0, _ava.default)('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', _renderComponent.default, _.default, _videoTranslate.default);
|
|
28
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/cockpit-popin/test/fixtures.js"],"names":["t","pass","MoleculeCockpitPopin","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureLoading","fixtureVideoTranslate"],"mappings":";;AAAA;;AACA;;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,gEAAL,EAAuED,wBAAvE,EAA6FN,SAA7F,EAAmHQ,gBAAnH;AACA,kBAAK,uEAAL,EAA8EF,wBAA9E,EAAoGN,SAApG,EAA0HS,uBAA1H","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCockpitPopin from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureVideoTranslate from './fixtures/video-translate';\n\ntest('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCockpitPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCockpitPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);\ntest('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);\ntest('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
+
|
|
13
|
+
var _withValue = _interopRequireDefault(require("./fixtures/with-value"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
|
|
17
|
+
(0, _ava.default)('Molecule › MoleculeSearch > should have valid propTypes', t => {
|
|
18
|
+
t.pass();
|
|
19
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
(0, _ava.default)('Molecule › MoleculeSearch › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
+
(0, _ava.default)('Molecule › MoleculeSearch › WithValue › should be rendered', _renderComponent.default, _.default, _withValue.default);
|
|
25
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["t","pass","MoleculeSearch","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureWithValue"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,yDAAL,EAAgEA,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAeC,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,0DAAL,EAAiEG,wBAAjE,EAAuFN,SAAvF,EAAuGO,gBAAvG;AACA,kBAAK,4DAAL,EAAmED,wBAAnE,EAAyFN,SAAzF,EAAyGQ,kBAAzG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
|