@coorpacademy/components 10.13.0 → 10.13.3-alpha.4
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/checkbox-with-title/test/fixtures.js +15 -0
- package/es/atom/checkbox-with-title/test/fixtures.js.map +1 -0
- package/es/atom/drag-and-drop/index.js +39 -36
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +110 -75
- package/es/atom/drag-and-drop/test/fixtures/default.js +3 -3
- package/es/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/loading.js +2 -1
- package/es/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-children.js +1 -0
- package/es/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js +2 -1
- package/es/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-video.js +3 -1
- package/es/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js +9 -0
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +1 -0
- package/es/atom/drag-and-drop/test/fixtures.js +2 -0
- package/es/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/es/atom/input-text-with-title/index.js +35 -0
- package/es/atom/input-text-with-title/index.js.map +1 -0
- package/es/atom/input-text-with-title/style.css +24 -0
- package/es/atom/input-text-with-title/test/fixtures/default.js +12 -0
- package/es/atom/input-text-with-title/test/fixtures/default.js.map +1 -0
- package/es/atom/input-text-with-title/test/fixtures/error.js +13 -0
- package/es/atom/input-text-with-title/test/fixtures/error.js.map +1 -0
- package/es/atom/input-text-with-title/test/fixtures.js +15 -0
- package/es/atom/input-text-with-title/test/fixtures.js.map +1 -0
- package/es/atom/loader/style.css +7 -3
- package/es/molecule/course-sections/index.js +20 -4
- package/es/molecule/course-sections/index.js.map +1 -1
- package/es/molecule/course-sections/style.css +17 -0
- package/es/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js +11 -0
- package/es/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js.map +1 -0
- package/es/molecule/course-sections/test/fixtures.js +2 -0
- package/es/molecule/course-sections/test/fixtures.js.map +1 -1
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js +15 -0
- package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/es/organism/course-selection/index.js +2 -1
- package/es/organism/course-selection/index.js.map +1 -1
- package/es/organism/course-selection/style.css +12 -3
- package/es/organism/course-selection/test/fixtures/loading.js +9 -0
- package/es/organism/course-selection/test/fixtures/loading.js.map +1 -0
- package/es/organism/course-selection/test/fixtures.js +2 -0
- package/es/organism/course-selection/test/fixtures.js.map +1 -1
- package/es/organism/search-and-chips-results/index.js +2 -1
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +10 -3
- package/es/organism/search-and-chips-results/test/fixtures/loading.js +9 -0
- package/es/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures.js +2 -0
- package/es/organism/search-and-chips-results/test/fixtures.js.map +1 -1
- package/es/organism/wizard-contents/style.css +0 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +1 -1
- package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -1
- package/es/template/back-office/brand-update/index.js +5 -2
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +10 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/lib/{molecule → atom}/checkbox-with-title/test/fixtures.js +4 -4
- package/lib/atom/checkbox-with-title/test/fixtures.js.map +1 -0
- package/lib/atom/drag-and-drop/index.js +39 -34
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +110 -75
- package/lib/atom/drag-and-drop/test/fixtures/default.js +3 -3
- package/lib/atom/drag-and-drop/test/fixtures/default.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/loading.js +2 -1
- package/lib/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js +1 -0
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js +2 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-image.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js +3 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js +18 -0
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +1 -0
- package/lib/atom/drag-and-drop/test/fixtures.js +3 -0
- package/lib/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/lib/atom/input-text-with-title/index.js +46 -0
- package/lib/atom/input-text-with-title/index.js.map +1 -0
- package/lib/atom/input-text-with-title/style.css +24 -0
- package/lib/atom/input-text-with-title/test/fixtures/default.js +21 -0
- package/lib/atom/input-text-with-title/test/fixtures/default.js.map +1 -0
- package/lib/atom/input-text-with-title/test/fixtures/error.js +22 -0
- package/lib/atom/input-text-with-title/test/fixtures/error.js.map +1 -0
- package/lib/atom/input-text-with-title/test/fixtures.js +25 -0
- package/lib/atom/input-text-with-title/test/fixtures.js.map +1 -0
- package/lib/atom/loader/style.css +7 -3
- package/lib/molecule/course-sections/index.js +21 -4
- package/lib/molecule/course-sections/index.js.map +1 -1
- package/lib/molecule/course-sections/style.css +17 -0
- package/lib/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js +21 -0
- package/lib/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js.map +1 -0
- package/lib/molecule/course-sections/test/fixtures.js +3 -0
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -1
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js +25 -0
- package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
- package/lib/organism/course-selection/index.js +2 -1
- package/lib/organism/course-selection/index.js.map +1 -1
- package/lib/organism/course-selection/style.css +12 -3
- package/lib/organism/course-selection/test/fixtures/loading.js +19 -0
- package/lib/organism/course-selection/test/fixtures/loading.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures.js +3 -0
- package/lib/organism/course-selection/test/fixtures.js.map +1 -1
- package/lib/organism/search-and-chips-results/index.js +2 -1
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +10 -3
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js +19 -0
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js +3 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js.map +1 -1
- package/lib/organism/wizard-contents/style.css +0 -1
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +2 -2
- package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -1
- package/lib/template/back-office/brand-update/index.js +5 -2
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +10 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/package.json +2 -2
- package/es/molecule/checkbox-with-title/test/fixtures.js +0 -15
- package/es/molecule/checkbox-with-title/test/fixtures.js.map +0 -1
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/molecule/checkbox-with-title/test/fixtures.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomCheckboxWithTitle from '..';
|
|
5
|
+
import fixtureChecked from './fixtures/checked';
|
|
6
|
+
import fixtureUnchecked from './fixtures/unchecked';
|
|
7
|
+
test('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Atom.AtomCheckboxWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);
|
|
14
|
+
test('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/checkbox-with-title/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomCheckboxWithTitle","fixtureChecked","fixtureUnchecked","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,qBAAP,MAAkC,IAAlC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAL,IAAI,CAAC,4DAAD,EAA+DM,CAAC,IAAI;AACtEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,qBAAqB,CAACK,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,sDAAqDF,GAAI,mEAAlF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,6DAAD,EAAgEE,oBAAhE,EAAsFC,qBAAtF,EAA6GC,cAA7G,CAAJ;AACAJ,IAAI,CAAC,+DAAD,EAAkEE,oBAAlE,EAAwFC,qBAAxF,EAA+GE,gBAA/G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCheckboxWithTitle from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCheckboxWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);\ntest('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import _constant from "lodash/fp/constant";
|
|
2
|
-
import _get from "lodash/fp/get";
|
|
3
2
|
import _uniqueId from "lodash/fp/uniqueId";
|
|
4
3
|
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
4
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
5
|
|
|
9
6
|
import React from 'react';
|
|
10
7
|
import PropTypes from 'prop-types';
|
|
11
|
-
import {
|
|
8
|
+
import { NovaLineStatusClose as Close, NovaSolidFilesBasicFileUpload2 as FileUploadIcon } from '@coorpacademy/nova-icons';
|
|
12
9
|
import Provider from '../provider';
|
|
13
10
|
import Loader from '../loader';
|
|
14
11
|
import style from './style.css';
|
|
12
|
+
import Button from '../button-link';
|
|
15
13
|
|
|
16
14
|
const constantNull = _constant(null);
|
|
17
15
|
|
|
@@ -38,12 +36,6 @@ class DragAndDrop extends React.Component {
|
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
render() {
|
|
41
|
-
const {
|
|
42
|
-
skin
|
|
43
|
-
} = this.context;
|
|
44
|
-
|
|
45
|
-
const brandColor = _get('common.brand', skin);
|
|
46
|
-
|
|
47
39
|
const idBox = _uniqueId('drop-box-');
|
|
48
40
|
|
|
49
41
|
const {
|
|
@@ -64,25 +56,36 @@ class DragAndDrop extends React.Component {
|
|
|
64
56
|
|
|
65
57
|
if (previewContent && previewContent.type === 'image') {
|
|
66
58
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
className: style.
|
|
59
|
+
className: style.preview
|
|
68
60
|
}, /*#__PURE__*/React.createElement("img", {
|
|
69
61
|
src: previewContent.src
|
|
70
62
|
}));
|
|
71
63
|
} else if (previewContent && previewContent.type === 'video') {
|
|
72
64
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className:
|
|
74
|
-
width: '300px'
|
|
75
|
-
})
|
|
65
|
+
className: style.preview
|
|
76
66
|
}, /*#__PURE__*/React.createElement("video", {
|
|
77
|
-
width: "100%",
|
|
78
67
|
controls: true,
|
|
79
68
|
src: previewContent.src,
|
|
80
69
|
type: "video/*"
|
|
81
70
|
}));
|
|
82
71
|
} else if (loading) {
|
|
83
72
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: style.
|
|
85
|
-
}, /*#__PURE__*/React.createElement(
|
|
73
|
+
className: style.loaderWrapper
|
|
74
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: style.loadingCancel
|
|
76
|
+
}, /*#__PURE__*/React.createElement(Close, {
|
|
77
|
+
"data-name": "reset-content-icon",
|
|
78
|
+
height: 16,
|
|
79
|
+
width: 16,
|
|
80
|
+
className: style.closeIcon,
|
|
81
|
+
onClick: onReset
|
|
82
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: style.loader
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Loader, {
|
|
85
|
+
theme: "coorpmanager"
|
|
86
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
87
|
+
className: style.loaderText
|
|
88
|
+
}, "Uploading"));
|
|
86
89
|
} else {
|
|
87
90
|
previewView = /*#__PURE__*/React.createElement("span", null, previewLabel);
|
|
88
91
|
}
|
|
@@ -98,30 +101,30 @@ class DragAndDrop extends React.Component {
|
|
|
98
101
|
className: style.closeIcon,
|
|
99
102
|
onClick: onReset
|
|
100
103
|
})) : null;
|
|
104
|
+
const buttonProps = {
|
|
105
|
+
label: uploadLabel,
|
|
106
|
+
'aria-label': 'aria button',
|
|
107
|
+
'data-name': 'default-button',
|
|
108
|
+
icon: {
|
|
109
|
+
position: 'left',
|
|
110
|
+
type: 'folders'
|
|
111
|
+
}
|
|
112
|
+
};
|
|
101
113
|
return /*#__PURE__*/React.createElement("div", {
|
|
102
114
|
className: style.wrapper,
|
|
103
115
|
"data-name": "drag-and-drop-wrapper"
|
|
104
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
105
|
-
className: style.
|
|
106
|
-
},
|
|
107
|
-
className: modified ? style.modified : style.previewWrapper
|
|
108
|
-
}, previewView), /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
}, modified || loading ? /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: style.modificationsContainer
|
|
118
|
+
}, previewView) : /*#__PURE__*/React.createElement("div", {
|
|
109
119
|
className: dragging ? style.dragging : style.inputWrapper,
|
|
110
120
|
id: idBox
|
|
111
|
-
}, /*#__PURE__*/React.createElement(
|
|
112
|
-
className: style.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/*#__PURE__*/
|
|
118
|
-
// eslint-disable-next-line react/no-danger
|
|
119
|
-
React.createElement("div", {
|
|
120
|
-
className: style.description,
|
|
121
|
-
dangerouslySetInnerHTML: {
|
|
122
|
-
__html: description
|
|
123
|
-
}
|
|
124
|
-
}) : null);
|
|
121
|
+
}, /*#__PURE__*/React.createElement(FileUploadIcon, {
|
|
122
|
+
className: style.icon
|
|
123
|
+
}), description ? /*#__PURE__*/React.createElement("div", {
|
|
124
|
+
className: style.description
|
|
125
|
+
}, description) : null, /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: style.title
|
|
127
|
+
}, title), dragging ? null : /*#__PURE__*/React.createElement(Button, buttonProps), children(this.handleDragStart, this.handleDragStop)), resetContent);
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/drag-and-drop/index.js"],"names":["React","PropTypes","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/drag-and-drop/index.js"],"names":["React","PropTypes","NovaLineStatusClose","Close","NovaSolidFilesBasicFileUpload2","FileUploadIcon","Provider","Loader","style","Button","constantNull","DragAndDrop","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","previewView","type","preview","src","loaderWrapper","loadingCancel","closeIcon","loader","loaderText","resetContent","resetUploadWrapper","resetSrcLabel","buttonProps","label","icon","position","wrapper","modificationsContainer","inputWrapper","skin","childContextTypes","propTypes","string","shape","bool","func"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,mBAAmB,IAAIC,KADzB,EAEEC,8BAA8B,IAAIC,cAFpC,QAGO,0BAHP;AAIA,OAAOC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SAAS,CAACqD,MADA;AAEjB7B,EAAAA,WAAW,EAAExB,SAAS,CAACqD,MAFN;AAGjB5B,EAAAA,WAAW,EAAEzB,SAAS,CAACqD,MAHN;AAIjB3B,EAAAA,YAAY,EAAE1B,SAAS,CAACqD,MAJP;AAKjB1B,EAAAA,cAAc,EAAE3B,SAAS,CAACsD,KAAV,CAAgB;AAC9BtB,IAAAA,IAAI,EAAEhC,SAAS,CAACqD,MADc;AAE9BnB,IAAAA,GAAG,EAAElC,SAAS,CAACqD;AAFe,GAAhB,CALC;AASjBzB,EAAAA,OAAO,EAAE5B,SAAS,CAACuD,IATF;AAUjB1B,EAAAA,QAAQ,EAAE7B,SAAS,CAACuD,IAVH;AAWjBjC,EAAAA,QAAQ,EAAEtB,SAAS,CAACwD,IAXH;AAYjB1B,EAAAA,OAAO,EAAE9B,SAAS,CAACwD;AAZF,C;AA0IrB,eAAe9C,WAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, get, constant} from 'lodash/fp';\nimport {\n NovaLineStatusClose as Close,\n NovaSolidFilesBasicFileUpload2 as FileUploadIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport Loader from '../loader';\nimport style from './style.css';\nimport Button from '../button-link';\n\nconst constantNull = constant(null);\n\nclass DragAndDrop extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n uploadLabel: PropTypes.string,\n previewLabel: PropTypes.string,\n previewContent: PropTypes.shape({\n type: PropTypes.string,\n src: PropTypes.string\n }),\n loading: PropTypes.bool,\n modified: PropTypes.bool,\n children: PropTypes.func,\n onReset: PropTypes.func\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {\n children = constantNull,\n title,\n description,\n uploadLabel,\n previewLabel = '',\n previewContent,\n loading = false,\n modified = false,\n onReset = null\n } = this.props;\n const {dragging} = this.state;\n\n let previewView = null;\n\n if (previewContent && previewContent.type === 'image') {\n previewView = (\n <div className={style.preview}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={style.preview}>\n <video controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loaderWrapper}>\n <div className={style.loadingCancel}>\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n <div className={style.loader}>\n <Loader theme='coorpmanager'/>\n </div>\n <span className={style.loaderText}>Uploading</span>\n </div>\n );\n } else {\n previewView = <span>{previewLabel}</span>;\n }\n\n const resetContent =\n previewContent && previewContent.src && onReset ? (\n <div className={style.resetUploadWrapper}>\n <div className={style.resetSrcLabel}>{previewContent.src}</div>\n <Close\n data-name=\"reset-content-icon\"\n height={16}\n width={16}\n className={style.closeIcon}\n onClick={onReset}\n />\n </div>\n ) : null;\n\n const buttonProps = {\n label: uploadLabel,\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'folders'\n },\n }\n\n return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n {modified || loading ? \n <div className={style.modificationsContainer}>{previewView}</div> \n : \n <div className={dragging ? style.dragging : style.inputWrapper} id={idBox}>\n <FileUploadIcon className={style.icon} />\n {description ? (\n <div className={style.description}>{description}</div>\n ) : null}\n <div className={style.title}>{title}</div>\n {dragging ? null : <Button {...buttonProps} />}\n {children(this.handleDragStart, this.handleDragStop)}\n </div>\n }\n {resetContent}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"file":"index.js"}
|
|
@@ -6,145 +6,180 @@
|
|
|
6
6
|
@value battle from colors;
|
|
7
7
|
@value light from colors;
|
|
8
8
|
@value xtraLightGrey from colors;
|
|
9
|
+
@value cm_grey_300 from colors;
|
|
10
|
+
@value cm_grey_700 from colors;
|
|
11
|
+
@value cm_grey_50 from colors;
|
|
12
|
+
@value cm_grey_200 from colors;
|
|
13
|
+
@value cm_grey_100 from colors;
|
|
14
|
+
@value cm_grey_400 from colors;
|
|
9
15
|
|
|
10
16
|
.wrapper {
|
|
11
|
-
|
|
17
|
+
font-family: "Gilroy";
|
|
18
|
+
/* height: 100%;
|
|
19
|
+
width: 100%; */
|
|
20
|
+
height: 133px;
|
|
21
|
+
width: 202px;
|
|
22
|
+
border-radius: 3px;
|
|
12
23
|
}
|
|
13
24
|
|
|
14
25
|
.title {
|
|
15
|
-
font-
|
|
16
|
-
font-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
margin-bottom: 20px;
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
font-weight: 700;
|
|
28
|
+
color: cm_grey_700;
|
|
29
|
+
margin-bottom: 14px;
|
|
20
30
|
}
|
|
21
31
|
|
|
22
32
|
.description {
|
|
23
|
-
font-
|
|
24
|
-
font-size: 13px;
|
|
33
|
+
font-size: 10px;
|
|
25
34
|
font-weight: 400;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
text-align: justify;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.previewWrapper {
|
|
35
|
+
color: cm_grey_300;
|
|
36
|
+
margin-bottom: 8px;
|
|
37
|
+
text-align: center;
|
|
33
38
|
width: 100%;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
margin-bottom: 10px;
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.modified {
|
|
43
|
-
composes: previewWrapper;
|
|
44
|
-
border: 2px solid battle;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
overflow: hidden;
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
.modificationsContainer {
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
border: none;
|
|
47
|
+
border-radius: 3px;;
|
|
48
|
+
background: cm_grey_50;
|
|
53
49
|
}
|
|
54
50
|
|
|
55
|
-
.
|
|
56
|
-
padding:
|
|
51
|
+
.preview {
|
|
52
|
+
padding: 8px;
|
|
57
53
|
width: 100%;
|
|
58
|
-
height:
|
|
54
|
+
height: 100%;
|
|
59
55
|
box-sizing: border-box;
|
|
60
56
|
display: flex;
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
.preview img, video {
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
border: 1px cm_grey_100 solid;
|
|
67
63
|
}
|
|
68
64
|
|
|
69
65
|
.inputWrapper {
|
|
66
|
+
background: cm_grey_50;
|
|
70
67
|
width: 100%;
|
|
71
|
-
height:
|
|
68
|
+
height: 100%;
|
|
72
69
|
box-sizing: border-box;
|
|
73
|
-
border: 1px dashed
|
|
74
|
-
border-radius:
|
|
70
|
+
border: 1px dashed cm_grey_200;
|
|
71
|
+
border-radius: 7px;
|
|
75
72
|
position: relative;
|
|
76
73
|
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
77
75
|
align-items: center;
|
|
78
76
|
justify-content: center;
|
|
77
|
+
padding: 14px 8px 8px 8px;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
text-overflow: ellipsis;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
.resetUploadWrapper {
|
|
82
84
|
width: 100%;
|
|
83
|
-
height:
|
|
85
|
+
height: 20px;
|
|
84
86
|
box-sizing: border-box;
|
|
85
|
-
background-color:
|
|
86
|
-
border: solid 1px light;
|
|
87
|
+
background-color: cm_grey_50;
|
|
87
88
|
border-radius: 3px;
|
|
88
|
-
position: relative;
|
|
89
89
|
display: flex;
|
|
90
90
|
align-items: center;
|
|
91
91
|
justify-content: space-between;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
font-size:
|
|
92
|
+
margin-top: 16px;
|
|
93
|
+
padding: 4px 8px;
|
|
94
|
+
font-size: 10px;
|
|
95
95
|
font-weight: 400;
|
|
96
|
-
margin-top: 15px;
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
.resetSrcLabel {
|
|
100
|
-
|
|
101
|
-
color: dark;
|
|
102
|
-
max-width: 220px;
|
|
99
|
+
color: cm_grey_700;
|
|
103
100
|
display: inline-block;
|
|
104
101
|
white-space: nowrap;
|
|
105
102
|
overflow: hidden;
|
|
106
103
|
text-overflow: ellipsis;
|
|
107
104
|
direction: rtl;
|
|
108
105
|
text-align: left;
|
|
109
|
-
margin-left: 9px;
|
|
110
106
|
}
|
|
111
107
|
|
|
112
108
|
.closeIcon {
|
|
113
|
-
margin-right: 9px;
|
|
114
109
|
cursor: pointer;
|
|
115
|
-
color:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
.closeIcon:hover {
|
|
119
|
-
color: black;
|
|
110
|
+
color: cm_grey_400;
|
|
111
|
+
padding: 6px;
|
|
120
112
|
}
|
|
121
113
|
|
|
122
114
|
.dragging {
|
|
123
115
|
composes: inputWrapper;
|
|
124
|
-
border:
|
|
116
|
+
border: 1px solid cm_grey_200;
|
|
117
|
+
background: cm_grey_100;
|
|
125
118
|
}
|
|
126
119
|
|
|
127
|
-
.
|
|
128
|
-
|
|
129
|
-
height: 34px;
|
|
130
|
-
margin-right: 10px;
|
|
131
|
-
transition: all 0.2s cubic-bezier(0.47, 1.04, 0.46, 2.16);
|
|
120
|
+
.dragging .description .icon .title {
|
|
121
|
+
font-size: 8px;
|
|
132
122
|
}
|
|
133
123
|
|
|
134
|
-
.dragging .
|
|
135
|
-
|
|
124
|
+
.dragging .title {
|
|
125
|
+
font-size: 10px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.dragging .icon {
|
|
129
|
+
transform: scale(0.85);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.icon {
|
|
133
|
+
width: 14px;
|
|
134
|
+
height: 14px;
|
|
135
|
+
transition: all 0.2s cubic-bezier(0.47, 1.04, 0.46, 2.16);
|
|
136
|
+
margin-bottom: 4px;
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
.uploadLabel {
|
|
139
|
-
font-
|
|
140
|
-
font-size: 18px;
|
|
141
|
-
text-transform: uppercase;
|
|
140
|
+
font-size: 14px;
|
|
142
141
|
font-weight: 700;
|
|
143
|
-
color:
|
|
142
|
+
color: cm_grey_700;
|
|
144
143
|
}
|
|
145
144
|
|
|
146
|
-
.
|
|
147
|
-
min-height: 100px;
|
|
148
|
-
border: none;
|
|
145
|
+
.loaderWrapper {
|
|
149
146
|
position: relative;
|
|
147
|
+
height: 100%;
|
|
148
|
+
width: 100%;
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: column;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
align-items: center;
|
|
150
153
|
}
|
|
154
|
+
|
|
155
|
+
.loader {
|
|
156
|
+
margin-bottom: 8px;
|
|
157
|
+
height: 14px;
|
|
158
|
+
width: 14px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.loaderText {
|
|
162
|
+
font-size: 10px;
|
|
163
|
+
font-weight: 400;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.loadingCancel {
|
|
167
|
+
display: none;
|
|
168
|
+
position: absolute;
|
|
169
|
+
top: 0;
|
|
170
|
+
right: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.button {
|
|
174
|
+
display: flex;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
align-items: center;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.folderIcon {
|
|
180
|
+
margin-right: 8px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.wrapper:hover .loadingCancel {
|
|
184
|
+
display: block;
|
|
185
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/default.js"],"names":["props","title","description","uploadLabel","previewLabel"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/default.js"],"names":["props","title","description","uploadLabel","previewLabel"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,kBADF;AAELC,IAAAA,WAAW,EAAE,8BAFR;AAGLC,IAAAA,WAAW,EAAE,QAHR;AAILC,IAAAA,YAAY,EAAE;AAJT;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Drag & drop here',\n description: 'JPG or PNG, smaller than 5mb',\n uploadLabel: 'Browse',\n previewLabel: 'File Preview'\n }\n};\n"],"file":"default.js"}
|
|
@@ -3,7 +3,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import Default from './default';
|
|
4
4
|
export default {
|
|
5
5
|
props: _extends(_extends({}, Default.props), {}, {
|
|
6
|
-
loading: true
|
|
6
|
+
loading: true,
|
|
7
|
+
modified: false
|
|
7
8
|
})
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=loading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/loading.js"],"names":["Default","props","loading"],"mappings":";;AAAA,OAAOA,OAAP,MAAoB,WAApB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAD,OAAO,CAACC,KADR;AAEHC,IAAAA,OAAO,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/loading.js"],"names":["Default","props","loading","modified"],"mappings":";;AAAA,OAAOA,OAAP,MAAoB,WAApB;AAEA,eAAe;AACbC,EAAAA,KAAK,wBACAD,OAAO,CAACC,KADR;AAEHC,IAAAA,OAAO,EAAE,IAFN;AAGHC,IAAAA,QAAQ,EAAE;AAHP;AADQ,CAAf","sourcesContent":["import Default from './default';\n\nexport default {\n props: {\n ...Default.props,\n loading: true,\n modified: false\n }\n};\n"],"file":"loading.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-children.js"],"names":["React","style","props","previewContent","type","src","title","displayName","uploadLabel","children","onDragStart","onDragStop","input"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iCAAlB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-children.js"],"names":["React","style","props","modified","previewContent","type","src","title","displayName","uploadLabel","children","onDragStart","onDragStop","input"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iCAAlB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,IADL;AAELC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS,KAFX;AAMLC,IAAAA,KAAK,EAAE,aANF;AAOLC,IAAAA,WAAW,EAAE,cAPR;AAQLC,IAAAA,WAAW,EAAE;AARR,GADM;AAWb;AACAC,EAAAA,QAAQ,EAAE,CAACC,WAAD,EAAcC,UAAd,kBACR;AACE,IAAA,SAAS,EAAEX,KAAK,CAACY,KADnB;AAEE,IAAA,GAAG,EAAC,GAFN;AAGE,IAAA,IAAI,EAAC,MAHP;AAIE,IAAA,MAAM,EAAC,SAJT;AAKE,IAAA,QAAQ,EAAE,MAAM,IALlB;AAME,IAAA,WAAW,EAAEF,WANf;AAOE,IAAA,MAAM,EAAEC,UAPV;AAQE,IAAA,WAAW,EAAEA;AARf;AAbW,CAAf","sourcesContent":["import React from 'react';\nimport style from '../../../image-upload/style.css';\n\nexport default {\n props: {\n modified: true,\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'\n },\n title: 'Desktop (*)',\n displayName: 'Upload image',\n uploadLabel: 'Upload'\n },\n // eslint-disable-next-line react/display-name\n children: (onDragStart, onDragStop) => (\n <input\n className={style.input}\n key=\"1\"\n type=\"file\"\n accept=\"image*/\"\n onChange={() => true}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n />\n )\n};\n"],"file":"with-children.js"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
+
modified: true,
|
|
3
4
|
title: 'Drag & Drop With Image',
|
|
4
5
|
description: 'Drag and drop component with an image',
|
|
5
6
|
uploadLabel: 'Upload Image(s)',
|
|
6
7
|
previewLabel: 'File Preview',
|
|
7
8
|
previewContent: {
|
|
8
9
|
type: 'image',
|
|
9
|
-
src: 'https://static.coorpacademy.com/content/up/raw/
|
|
10
|
+
src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-image.js"],"names":["props","title","description","uploadLabel","previewLabel","previewContent","type","src"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-image.js"],"names":["props","modified","title","description","uploadLabel","previewLabel","previewContent","type","src"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,IADL;AAELC,IAAAA,KAAK,EAAE,wBAFF;AAGLC,IAAAA,WAAW,EAAE,uCAHR;AAILC,IAAAA,WAAW,EAAE,iBAJR;AAKLC,IAAAA,YAAY,EAAE,cALT;AAMLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;AANX;AADM,CAAf","sourcesContent":["export default {\n props: {\n modified: true,\n title: 'Drag & Drop With Image',\n description: 'Drag and drop component with an image',\n uploadLabel: 'Upload Image(s)',\n previewLabel: 'File Preview',\n previewContent: {\n type: 'image',\n src: 'https://static.coorpacademy.com/content/up/raw/logo_coorp-1491560495763.svg'\n }\n }\n};\n"],"file":"with-image.js"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
+
modified: true,
|
|
3
4
|
title: 'Drag & Drop',
|
|
4
5
|
description: 'Drag and drop component with a video',
|
|
5
6
|
uploadLabel: 'Upload',
|
|
@@ -7,7 +8,8 @@ export default {
|
|
|
7
8
|
previewContent: {
|
|
8
9
|
type: 'video',
|
|
9
10
|
src: 'https://www.w3schools.com/tags/movie.mp4'
|
|
10
|
-
}
|
|
11
|
+
},
|
|
12
|
+
onReset: () => console.log('reset')
|
|
11
13
|
}
|
|
12
14
|
};
|
|
13
15
|
//# sourceMappingURL=with-video.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-video.js"],"names":["props","title","description","uploadLabel","previewLabel","previewContent","type","src"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-video.js"],"names":["props","modified","title","description","uploadLabel","previewLabel","previewContent","type","src","onReset","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,IADL;AAELC,IAAAA,KAAK,EAAE,aAFF;AAGLC,IAAAA,WAAW,EAAE,sCAHR;AAILC,IAAAA,WAAW,EAAE,QAJR;AAKLC,IAAAA,YAAY,EAAE,cALT;AAMLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS,KANX;AAULC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AAVV;AADM,CAAf","sourcesContent":["export default {\n props: {\n modified: true,\n title: 'Drag & Drop',\n description: 'Drag and drop component with a video',\n uploadLabel: 'Upload',\n previewLabel: 'File Preview',\n previewContent: {\n type: 'video',\n src: 'https://www.w3schools.com/tags/movie.mp4'\n },\n onReset: () => console.log('reset')\n }\n};\n"],"file":"with-video.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import props from './default';
|
|
4
|
+
export default {
|
|
5
|
+
props: _extends(_extends({}, props.props), {}, {
|
|
6
|
+
description: 'Max file size: 5MO. Recommended format: SVG (if your client uses a majority of IE, use PNG format instead). Recommended aspect ratio : horizontal 2:1 (e.g. 500px x 250px). Maximum recommended aspect ratio 1:1 (e.g. 500x500, which means that it should not be taller than its width).'
|
|
7
|
+
})
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=withLongDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/withLongDescription.js"],"names":["props","description"],"mappings":";;AACA,OAAOA,KAAP,MAAkB,WAAlB;AAEA,eAAe;AACXA,EAAAA,KAAK,wBACEA,KAAK,CAACA,KADR;AAEDC,IAAAA,WAAW,EAAE;AAFZ;AADM,CAAf","sourcesContent":["\nimport props from './default';\n\nexport default {\n props: {\n ...props.props,\n description: 'Max file size: 5MO. Recommended format: SVG (if your client uses a majority of IE, use PNG format instead). Recommended aspect ratio : horizontal 2:1 (e.g. 500px x 250px). Maximum recommended aspect ratio 1:1 (e.g. 500x500, which means that it should not be taller than its width).'\n }\n}\n"],"file":"withLongDescription.js"}
|
|
@@ -8,6 +8,7 @@ import fixtureWithChildren from './fixtures/with-children';
|
|
|
8
8
|
import fixtureWithImageReset from './fixtures/with-image-reset';
|
|
9
9
|
import fixtureWithImage from './fixtures/with-image';
|
|
10
10
|
import fixtureWithVideo from './fixtures/with-video';
|
|
11
|
+
import fixtureWithLongDescription from './fixtures/withLongDescription';
|
|
11
12
|
test('Atom › AtomDragAndDrop > should have valid propTypes', t => {
|
|
12
13
|
t.pass();
|
|
13
14
|
forEach(AtomDragAndDrop.propTypes, (value, key) => {
|
|
@@ -20,4 +21,5 @@ test('Atom › AtomDragAndDrop › WithChildren › should be rendered', renderC
|
|
|
20
21
|
test('Atom › AtomDragAndDrop › WithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImageReset);
|
|
21
22
|
test('Atom › AtomDragAndDrop › WithImage › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImage);
|
|
22
23
|
test('Atom › AtomDragAndDrop › WithVideo › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithVideo);
|
|
24
|
+
test('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithLongDescription);
|
|
23
25
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomDragAndDrop","fixtureDefault","fixtureLoading","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithVideo","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,eAAP,MAA4B,IAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/drag-and-drop/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomDragAndDrop","fixtureDefault","fixtureLoading","fixtureWithChildren","fixtureWithImageReset","fixtureWithImage","fixtureWithVideo","fixtureWithLongDescription","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,eAAP,MAA4B,IAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,0BAAP,MAAuC,gCAAvC;AAEAV,IAAI,CAAC,sDAAD,EAAyDW,CAAC,IAAI;AAChEA,EAAAA,CAAC,CAACC,IAAF;AACAX,EAAAA,OAAO,CAACE,eAAe,CAACU,SAAjB,EAA4B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,gDAA+CF,GAAI,mEAA5E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAf,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,eAAhF,EAAiGC,cAAjG,CAAJ;AACAJ,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,eAAhF,EAAiGE,cAAjG,CAAJ;AACAL,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,eAArF,EAAsGG,mBAAtG,CAAJ;AACAN,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,eAAvF,EAAwGI,qBAAxG,CAAJ;AACAP,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGK,gBAAnG,CAAJ;AACAR,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,eAAlF,EAAmGM,gBAAnG,CAAJ;AACAT,IAAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,eAA5F,EAA6GO,0BAA7G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomDragAndDrop from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureWithChildren from './fixtures/with-children';\nimport fixtureWithImageReset from './fixtures/with-image-reset';\nimport fixtureWithImage from './fixtures/with-image';\nimport fixtureWithVideo from './fixtures/with-video';\nimport fixtureWithLongDescription from './fixtures/withLongDescription';\n\ntest('Atom › AtomDragAndDrop > should have valid propTypes', t => {\n t.pass();\n forEach(AtomDragAndDrop.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomDragAndDrop.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomDragAndDrop › Default › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureDefault);\ntest('Atom › AtomDragAndDrop › Loading › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureLoading);\ntest('Atom › AtomDragAndDrop › WithChildren › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithChildren);\ntest('Atom › AtomDragAndDrop › WithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImageReset);\ntest('Atom › AtomDragAndDrop › WithImage › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImage);\ntest('Atom › AtomDragAndDrop › WithVideo › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithVideo);\ntest('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithLongDescription);\n"],"file":"fixtures.js"}
|