@coorpacademy/components 10.13.3-alpha.6 → 10.13.5
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/drag-and-drop/index.js +43 -40
- package/es/atom/drag-and-drop/index.js.map +1 -1
- package/es/atom/drag-and-drop/style.css +75 -108
- 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 +1 -2
- package/es/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures/with-children.js +0 -1
- 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 +1 -2
- 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 +1 -3
- package/es/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/es/atom/drag-and-drop/test/fixtures.js +0 -2
- package/es/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/es/atom/input-text/style.css +1 -1
- package/es/atom/input-text-with-title/index.js +4 -2
- package/es/atom/input-text-with-title/index.js.map +1 -1
- package/es/atom/input-text-with-title/style.css +6 -2
- package/es/atom/input-text-with-title/test/fixtures/error.js +3 -1
- package/es/atom/input-text-with-title/test/fixtures/error.js.map +1 -1
- package/es/atom/loader/style.css +3 -7
- package/es/atom/select/index.js +4 -1
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/course-sections/index.js +1 -4
- package/es/molecule/course-sections/index.js.map +1 -1
- package/es/molecule/course-sections/style.css +2 -15
- package/es/organism/course-selection/index.js +1 -2
- package/es/organism/course-selection/index.js.map +1 -1
- package/es/organism/course-selection/style.css +3 -12
- package/es/organism/course-selection/test/fixtures.js +0 -2
- package/es/organism/course-selection/test/fixtures.js.map +1 -1
- package/es/organism/search-and-chips-results/index.js +1 -2
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +3 -10
- package/es/organism/search-and-chips-results/test/fixtures.js +0 -2
- package/es/organism/search-and-chips-results/test/fixtures.js.map +1 -1
- package/es/template/back-office/brand-update/index.js +2 -5
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +1 -10
- package/es/util/button-icons.js +2 -3
- package/es/util/button-icons.js.map +1 -1
- package/lib/atom/drag-and-drop/index.js +40 -41
- package/lib/atom/drag-and-drop/index.js.map +1 -1
- package/lib/atom/drag-and-drop/style.css +75 -108
- 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 +1 -2
- package/lib/atom/drag-and-drop/test/fixtures/loading.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures/with-children.js +0 -1
- 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 +1 -2
- 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 +1 -3
- package/lib/atom/drag-and-drop/test/fixtures/with-video.js.map +1 -1
- package/lib/atom/drag-and-drop/test/fixtures.js +0 -3
- package/lib/atom/drag-and-drop/test/fixtures.js.map +1 -1
- package/lib/atom/input-text/style.css +1 -1
- package/lib/atom/input-text-with-title/index.js +4 -2
- package/lib/atom/input-text-with-title/index.js.map +1 -1
- package/lib/atom/input-text-with-title/style.css +6 -2
- package/lib/atom/input-text-with-title/test/fixtures/error.js +3 -1
- package/lib/atom/input-text-with-title/test/fixtures/error.js.map +1 -1
- package/lib/atom/loader/style.css +3 -7
- package/lib/atom/select/index.js +4 -1
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/course-sections/index.js +1 -4
- package/lib/molecule/course-sections/index.js.map +1 -1
- package/lib/molecule/course-sections/style.css +2 -15
- package/lib/organism/course-selection/index.js +1 -2
- package/lib/organism/course-selection/index.js.map +1 -1
- package/lib/organism/course-selection/style.css +3 -12
- package/lib/organism/course-selection/test/fixtures.js +0 -3
- package/lib/organism/course-selection/test/fixtures.js.map +1 -1
- package/lib/organism/search-and-chips-results/index.js +1 -2
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +3 -10
- package/lib/organism/search-and-chips-results/test/fixtures.js +0 -3
- package/lib/organism/search-and-chips-results/test/fixtures.js.map +1 -1
- package/lib/template/back-office/brand-update/index.js +2 -5
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +1 -10
- package/lib/util/button-icons.js +1 -2
- package/lib/util/button-icons.js.map +1 -1
- package/package.json +2 -2
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js +0 -9
- package/es/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +0 -1
- package/es/atom/review-header-step-item/test/fixtures.js +0 -19
- package/es/atom/review-header-step-item/test/fixtures.js.map +0 -1
- package/es/molecule/review-header-steps/test/fixtures.js +0 -23
- package/es/molecule/review-header-steps/test/fixtures.js.map +0 -1
- package/es/organism/course-selection/test/fixtures/loading.js +0 -9
- package/es/organism/course-selection/test/fixtures/loading.js.map +0 -1
- package/es/organism/search-and-chips-results/test/fixtures/loading.js +0 -9
- package/es/organism/search-and-chips-results/test/fixtures/loading.js.map +0 -1
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js +0 -18
- package/lib/atom/drag-and-drop/test/fixtures/withLongDescription.js.map +0 -1
- package/lib/atom/review-header-step-item/test/fixtures.js +0 -31
- package/lib/atom/review-header-step-item/test/fixtures.js.map +0 -1
- package/lib/molecule/review-header-steps/test/fixtures.js +0 -37
- package/lib/molecule/review-header-steps/test/fixtures.js.map +0 -1
- package/lib/organism/course-selection/test/fixtures/loading.js +0 -19
- package/lib/organism/course-selection/test/fixtures/loading.js.map +0 -1
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js +0 -19
- package/lib/organism/search-and-chips-results/test/fixtures/loading.js.map +0 -1
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import _isEmpty from "lodash/fp/isEmpty";
|
|
2
1
|
import _constant from "lodash/fp/constant";
|
|
2
|
+
import _get from "lodash/fp/get";
|
|
3
3
|
import _uniqueId from "lodash/fp/uniqueId";
|
|
4
|
+
|
|
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
|
+
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
|
+
|
|
4
9
|
import React from 'react';
|
|
5
10
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
11
|
+
import { NovaSolidDataTransferDataUpload1 as UploadIcon, NovaLineStatusClose as Close } from '@coorpacademy/nova-icons';
|
|
7
12
|
import Provider from '../provider';
|
|
8
13
|
import Loader from '../loader';
|
|
9
14
|
import style from './style.css';
|
|
10
|
-
import Button from '../button-link';
|
|
11
15
|
|
|
12
16
|
const constantNull = _constant(null);
|
|
13
17
|
|
|
@@ -34,6 +38,12 @@ class DragAndDrop extends React.Component {
|
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
render() {
|
|
41
|
+
const {
|
|
42
|
+
skin
|
|
43
|
+
} = this.context;
|
|
44
|
+
|
|
45
|
+
const brandColor = _get('common.brand', skin);
|
|
46
|
+
|
|
37
47
|
const idBox = _uniqueId('drop-box-');
|
|
38
48
|
|
|
39
49
|
const {
|
|
@@ -54,36 +64,25 @@ class DragAndDrop extends React.Component {
|
|
|
54
64
|
|
|
55
65
|
if (previewContent && previewContent.type === 'image') {
|
|
56
66
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
57
|
-
className: style.
|
|
67
|
+
className: style.previewView
|
|
58
68
|
}, /*#__PURE__*/React.createElement("img", {
|
|
59
69
|
src: previewContent.src
|
|
60
70
|
}));
|
|
61
71
|
} else if (previewContent && previewContent.type === 'video') {
|
|
62
72
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
className: style.
|
|
73
|
+
className: _extends(_extends({}, style.previewView), {}, {
|
|
74
|
+
width: '300px'
|
|
75
|
+
})
|
|
64
76
|
}, /*#__PURE__*/React.createElement("video", {
|
|
77
|
+
width: "100%",
|
|
65
78
|
controls: true,
|
|
66
79
|
src: previewContent.src,
|
|
67
80
|
type: "video/*"
|
|
68
81
|
}));
|
|
69
82
|
} else if (loading) {
|
|
70
83
|
previewView = /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: style.
|
|
72
|
-
}, /*#__PURE__*/React.createElement(
|
|
73
|
-
className: style.loadingCancel
|
|
74
|
-
}, /*#__PURE__*/React.createElement(Close, {
|
|
75
|
-
"data-name": "reset-content-icon",
|
|
76
|
-
height: 16,
|
|
77
|
-
width: 16,
|
|
78
|
-
className: style.closeIcon,
|
|
79
|
-
onClick: onReset
|
|
80
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
className: style.loader
|
|
82
|
-
}, /*#__PURE__*/React.createElement(Loader, {
|
|
83
|
-
theme: "coorpmanager"
|
|
84
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
85
|
-
className: style.loaderText
|
|
86
|
-
}, "Uploading"));
|
|
84
|
+
className: style.loading
|
|
85
|
+
}, /*#__PURE__*/React.createElement(Loader, null));
|
|
87
86
|
} else {
|
|
88
87
|
previewView = /*#__PURE__*/React.createElement("span", null, previewLabel);
|
|
89
88
|
}
|
|
@@ -99,34 +98,38 @@ class DragAndDrop extends React.Component {
|
|
|
99
98
|
className: style.closeIcon,
|
|
100
99
|
onClick: onReset
|
|
101
100
|
})) : null;
|
|
102
|
-
const buttonProps = {
|
|
103
|
-
label: uploadLabel,
|
|
104
|
-
'aria-label': 'aria button',
|
|
105
|
-
'data-name': 'default-button',
|
|
106
|
-
icon: {
|
|
107
|
-
position: 'left',
|
|
108
|
-
type: 'folders'
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
101
|
return /*#__PURE__*/React.createElement("div", {
|
|
112
102
|
className: style.wrapper,
|
|
113
103
|
"data-name": "drag-and-drop-wrapper"
|
|
114
|
-
},
|
|
115
|
-
className: style.
|
|
116
|
-
},
|
|
104
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: style.title
|
|
106
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
className: modified ? style.modified : style.previewWrapper
|
|
108
|
+
}, previewView), /*#__PURE__*/React.createElement("div", {
|
|
117
109
|
className: dragging ? style.dragging : style.inputWrapper,
|
|
118
110
|
id: idBox
|
|
119
|
-
}, /*#__PURE__*/React.createElement(
|
|
120
|
-
className: style.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
}, /*#__PURE__*/React.createElement(UploadIcon, {
|
|
112
|
+
className: style.arrow,
|
|
113
|
+
color: brandColor
|
|
114
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: style.uploadLabel
|
|
116
|
+
}, uploadLabel), children(this.handleDragStart, this.handleDragStop)), resetContent, description ?
|
|
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);
|
|
126
125
|
}
|
|
127
126
|
|
|
128
127
|
}
|
|
129
128
|
|
|
129
|
+
_defineProperty(DragAndDrop, "contextTypes", {
|
|
130
|
+
skin: Provider.childContextTypes.skin
|
|
131
|
+
});
|
|
132
|
+
|
|
130
133
|
DragAndDrop.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
131
134
|
title: PropTypes.string,
|
|
132
135
|
description: PropTypes.string,
|
|
@@ -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","NovaSolidDataTransferDataUpload1","UploadIcon","NovaLineStatusClose","Close","Provider","Loader","style","constantNull","DragAndDrop","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","skin","context","brandColor","idBox","children","title","description","uploadLabel","previewLabel","previewContent","loading","modified","onReset","previewView","type","src","width","resetContent","resetUploadWrapper","resetSrcLabel","closeIcon","wrapper","previewWrapper","inputWrapper","arrow","__html","childContextTypes","propTypes","string","shape","bool","func"],"mappings":"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","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, get, constant} from 'lodash/fp';\nimport {\n NovaSolidDataTransferDataUpload1 as UploadIcon,\n NovaLineStatusClose as Close\n} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport Loader from '../loader';\nimport style from './style.css';\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 {skin} = this.context;\n const brandColor = get('common.brand', skin);\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.previewView}>\n <img src={previewContent.src} />\n </div>\n );\n } else if (previewContent && previewContent.type === 'video') {\n previewView = (\n <div className={{...style.previewView, width: '300px'}}>\n <video width=\"100%\" controls src={previewContent.src} type=\"video/*\" />\n </div>\n );\n } else if (loading) {\n previewView = (\n <div className={style.loading}>\n <Loader />\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 return (\n <div className={style.wrapper} data-name=\"drag-and-drop-wrapper\">\n <div className={style.title}>{title}</div>\n <div className={modified ? style.modified : style.previewWrapper}>{previewView}</div>\n <div className={dragging ? style.dragging : style.inputWrapper} id={idBox}>\n <UploadIcon className={style.arrow} color={brandColor} />\n <div className={style.uploadLabel}>{uploadLabel}</div>\n {children(this.handleDragStart, this.handleDragStop)}\n </div>\n {resetContent}\n {description ? (\n // eslint-disable-next-line react/no-danger\n <div className={style.description} dangerouslySetInnerHTML={{__html: description}} />\n ) : null}\n </div>\n );\n }\n}\n\nexport default DragAndDrop;\n"],"file":"index.js"}
|
|
@@ -6,178 +6,145 @@
|
|
|
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;
|
|
15
9
|
|
|
16
10
|
.wrapper {
|
|
17
|
-
|
|
18
|
-
height: 133px;
|
|
19
|
-
width: 202px;
|
|
20
|
-
border-radius: 3px;
|
|
11
|
+
width: 360px;
|
|
21
12
|
}
|
|
22
13
|
|
|
23
14
|
.title {
|
|
24
|
-
font-
|
|
25
|
-
font-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
font-family: "Gilroy";
|
|
16
|
+
font-size: 15px;
|
|
17
|
+
text-transform: none;
|
|
18
|
+
color: dark;
|
|
19
|
+
margin-bottom: 20px;
|
|
28
20
|
}
|
|
29
21
|
|
|
30
22
|
.description {
|
|
31
|
-
font-
|
|
23
|
+
font-family: 'Gilroy';
|
|
24
|
+
font-size: 13px;
|
|
32
25
|
font-weight: 400;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
text-overflow: ellipsis;
|
|
38
|
-
overflow: hidden;
|
|
26
|
+
font-style: italic;
|
|
27
|
+
color: dark;
|
|
28
|
+
margin: 10px 0;
|
|
29
|
+
text-align: justify;
|
|
39
30
|
}
|
|
40
31
|
|
|
41
|
-
.
|
|
32
|
+
.previewWrapper {
|
|
42
33
|
width: 100%;
|
|
43
|
-
|
|
44
|
-
border:
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
border: 1px dashed medium;
|
|
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;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.previewWrapper span {
|
|
48
|
+
font-family: 'Gilroy';
|
|
49
|
+
color: dark;
|
|
50
|
+
font-size: 15px;
|
|
51
|
+
font-weight: 700;
|
|
52
|
+
line-height: 100px;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
|
-
.
|
|
50
|
-
padding:
|
|
55
|
+
.previewView {
|
|
56
|
+
padding: 10px;
|
|
51
57
|
width: 100%;
|
|
52
|
-
height:
|
|
58
|
+
height: 100px;
|
|
53
59
|
box-sizing: border-box;
|
|
54
60
|
display: flex;
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
.
|
|
58
|
-
width: 100%;
|
|
59
|
-
height: 100%;
|
|
60
|
-
|
|
63
|
+
.previewView img {
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
max-height: 100%;
|
|
66
|
+
margin: auto;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
.inputWrapper {
|
|
64
|
-
background: cm_grey_50;
|
|
65
70
|
width: 100%;
|
|
66
|
-
height:
|
|
71
|
+
height: 70px;
|
|
67
72
|
box-sizing: border-box;
|
|
68
|
-
border: 1px dashed
|
|
69
|
-
border-radius:
|
|
73
|
+
border: 1px dashed medium;
|
|
74
|
+
border-radius: 3px;
|
|
70
75
|
position: relative;
|
|
71
76
|
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
77
|
align-items: center;
|
|
74
78
|
justify-content: center;
|
|
75
|
-
padding: 14px 8px 8px 8px;
|
|
76
|
-
white-space: nowrap;
|
|
77
|
-
overflow: hidden;
|
|
78
|
-
text-overflow: ellipsis;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.resetUploadWrapper {
|
|
82
82
|
width: 100%;
|
|
83
|
-
height:
|
|
83
|
+
height: 30px;
|
|
84
84
|
box-sizing: border-box;
|
|
85
|
-
background-color:
|
|
85
|
+
background-color: xtraLightGrey;
|
|
86
|
+
border: solid 1px light;
|
|
86
87
|
border-radius: 3px;
|
|
88
|
+
position: relative;
|
|
87
89
|
display: flex;
|
|
88
90
|
align-items: center;
|
|
89
91
|
justify-content: space-between;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
font-size:
|
|
92
|
+
/* fonts */
|
|
93
|
+
font-family: Gilroy;
|
|
94
|
+
font-size: 13px;
|
|
93
95
|
font-weight: 400;
|
|
96
|
+
margin-top: 15px;
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
.resetSrcLabel {
|
|
97
|
-
|
|
100
|
+
font-family: Gilroy;
|
|
101
|
+
color: dark;
|
|
102
|
+
max-width: 220px;
|
|
98
103
|
display: inline-block;
|
|
99
104
|
white-space: nowrap;
|
|
100
105
|
overflow: hidden;
|
|
101
106
|
text-overflow: ellipsis;
|
|
102
107
|
direction: rtl;
|
|
103
108
|
text-align: left;
|
|
109
|
+
margin-left: 9px;
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
.closeIcon {
|
|
113
|
+
margin-right: 9px;
|
|
107
114
|
cursor: pointer;
|
|
108
|
-
color:
|
|
109
|
-
padding: 6px;
|
|
115
|
+
color: dark;
|
|
110
116
|
}
|
|
111
117
|
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
border: 1px solid cm_grey_200;
|
|
115
|
-
background: cm_grey_100;
|
|
118
|
+
.closeIcon:hover {
|
|
119
|
+
color: black;
|
|
116
120
|
}
|
|
117
121
|
|
|
118
|
-
.dragging
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
.dragging .title {
|
|
123
|
-
font-size: 10px;
|
|
122
|
+
.dragging {
|
|
123
|
+
composes: inputWrapper;
|
|
124
|
+
border: 3px dashed brand;
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
.
|
|
127
|
-
|
|
127
|
+
.arrow {
|
|
128
|
+
width: 34px;
|
|
129
|
+
height: 34px;
|
|
130
|
+
margin-right: 10px;
|
|
131
|
+
transition: all 0.2s cubic-bezier(0.47, 1.04, 0.46, 2.16);
|
|
128
132
|
}
|
|
129
133
|
|
|
130
|
-
.
|
|
131
|
-
|
|
132
|
-
height: 14px;
|
|
133
|
-
transition: all 0.2s cubic-bezier(0.47, 1.04, 0.46, 2.16);
|
|
134
|
-
margin-bottom: 4px;
|
|
134
|
+
.dragging .arrow {
|
|
135
|
+
transform: scale(1.2);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
.uploadLabel {
|
|
138
|
-
font-
|
|
139
|
+
font-family: 'Gilroy';
|
|
140
|
+
font-size: 18px;
|
|
141
|
+
text-transform: uppercase;
|
|
139
142
|
font-weight: 700;
|
|
140
|
-
color:
|
|
143
|
+
color: dark;
|
|
141
144
|
}
|
|
142
145
|
|
|
143
|
-
.
|
|
146
|
+
.loading {
|
|
147
|
+
min-height: 100px;
|
|
148
|
+
border: none;
|
|
144
149
|
position: relative;
|
|
145
|
-
height: 100%;
|
|
146
|
-
width: 100%;
|
|
147
|
-
display: flex;
|
|
148
|
-
flex-direction: column;
|
|
149
|
-
justify-content: center;
|
|
150
|
-
align-items: center;
|
|
151
150
|
}
|
|
152
|
-
|
|
153
|
-
.loader {
|
|
154
|
-
margin-bottom: 8px;
|
|
155
|
-
height: 14px;
|
|
156
|
-
width: 14px;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.loaderText {
|
|
160
|
-
font-size: 10px;
|
|
161
|
-
font-weight: 400;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.loadingCancel {
|
|
165
|
-
display: none;
|
|
166
|
-
position: absolute;
|
|
167
|
-
top: 0;
|
|
168
|
-
right: 0;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.button {
|
|
172
|
-
display: flex;
|
|
173
|
-
justify-content: center;
|
|
174
|
-
align-items: center;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.folderIcon {
|
|
178
|
-
margin-right: 8px;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.wrapper:hover .loadingCancel {
|
|
182
|
-
display: block;
|
|
183
|
-
}
|
|
@@ -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,aADF;AAELC,IAAAA,WAAW,EAAE,yBAFR;AAGLC,IAAAA,WAAW,EAAE,QAHR;AAILC,IAAAA,YAAY,EAAE;AAJT;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Drag & Drop',\n description: 'Drag and drop component',\n uploadLabel: 'Upload',\n previewLabel: 'File Preview'\n }\n};\n"],"file":"default.js"}
|
|
@@ -3,8 +3,7 @@ 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
|
|
7
|
-
modified: false
|
|
6
|
+
loading: true
|
|
8
7
|
})
|
|
9
8
|
};
|
|
10
9
|
//# sourceMappingURL=loading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/loading.js"],"names":["Default","props","loading"
|
|
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;AAFN;AADQ,CAAf","sourcesContent":["import Default from './default';\n\nexport default {\n props: {\n ...Default.props,\n loading: true\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","
|
|
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,KADX;AAKLC,IAAAA,KAAK,EAAE,aALF;AAMLC,IAAAA,WAAW,EAAE,cANR;AAOLC,IAAAA,WAAW,EAAE;AAPR,GADM;AAUb;AACAC,EAAAA,QAAQ,EAAE,CAACC,WAAD,EAAcC,UAAd,kBACR;AACE,IAAA,SAAS,EAAEV,KAAK,CAACW,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;AAZW,CAAf","sourcesContent":["import React from 'react';\nimport style from '../../../image-upload/style.css';\n\nexport default {\n props: {\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,13 +1,12 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
modified: true,
|
|
4
3
|
title: 'Drag & Drop With Image',
|
|
5
4
|
description: 'Drag and drop component with an image',
|
|
6
5
|
uploadLabel: 'Upload Image(s)',
|
|
7
6
|
previewLabel: 'File Preview',
|
|
8
7
|
previewContent: {
|
|
9
8
|
type: 'image',
|
|
10
|
-
src: 'https://static.coorpacademy.com/content/up/raw/
|
|
9
|
+
src: 'https://static.coorpacademy.com/content/up/raw/logo_mobile-1491560713685.svg'
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-image.js"],"names":["props","
|
|
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,KAAK,EAAE,wBADF;AAELC,IAAAA,WAAW,EAAE,uCAFR;AAGLC,IAAAA,WAAW,EAAE,iBAHR;AAILC,IAAAA,YAAY,EAAE,cAJT;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;AALX;AADM,CAAf","sourcesContent":["export default {\n props: {\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_mobile-1491560713685.svg'\n }\n }\n};\n"],"file":"with-image.js"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
modified: true,
|
|
4
3
|
title: 'Drag & Drop',
|
|
5
4
|
description: 'Drag and drop component with a video',
|
|
6
5
|
uploadLabel: 'Upload',
|
|
@@ -8,8 +7,7 @@ export default {
|
|
|
8
7
|
previewContent: {
|
|
9
8
|
type: 'video',
|
|
10
9
|
src: 'https://www.w3schools.com/tags/movie.mp4'
|
|
11
|
-
}
|
|
12
|
-
onReset: () => console.log('reset')
|
|
10
|
+
}
|
|
13
11
|
}
|
|
14
12
|
};
|
|
15
13
|
//# sourceMappingURL=with-video.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/atom/drag-and-drop/test/fixtures/with-video.js"],"names":["props","
|
|
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,KAAK,EAAE,aADF;AAELC,IAAAA,WAAW,EAAE,sCAFR;AAGLC,IAAAA,WAAW,EAAE,QAHR;AAILC,IAAAA,YAAY,EAAE,cAJT;AAKLC,IAAAA,cAAc,EAAE;AACdC,MAAAA,IAAI,EAAE,OADQ;AAEdC,MAAAA,GAAG,EAAE;AAFS;AALX;AADM,CAAf","sourcesContent":["export default {\n props: {\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 }\n};\n"],"file":"with-video.js"}
|
|
@@ -8,7 +8,6 @@ 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';
|
|
12
11
|
test('Atom › AtomDragAndDrop > should have valid propTypes', t => {
|
|
13
12
|
t.pass();
|
|
14
13
|
forEach(AtomDragAndDrop.propTypes, (value, key) => {
|
|
@@ -21,5 +20,4 @@ test('Atom › AtomDragAndDrop › WithChildren › should be rendered', renderC
|
|
|
21
20
|
test('Atom › AtomDragAndDrop › WithImageReset › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImageReset);
|
|
22
21
|
test('Atom › AtomDragAndDrop › WithImage › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithImage);
|
|
23
22
|
test('Atom › AtomDragAndDrop › WithVideo › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithVideo);
|
|
24
|
-
test('Atom › AtomDragAndDrop › WithLongDescription › should be rendered', renderComponentMacro, AtomDragAndDrop, fixtureWithLongDescription);
|
|
25
23
|
//# 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","
|
|
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;AAEAT,IAAI,CAAC,sDAAD,EAAyDU,CAAC,IAAI;AAChEA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,eAAe,CAACS,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;AAOAd,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","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';\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);\n"],"file":"fixtures.js"}
|
|
@@ -12,6 +12,7 @@ const InputTextWithTitle = props => {
|
|
|
12
12
|
'data-name': dataName,
|
|
13
13
|
'aria-label': ariaLabel
|
|
14
14
|
} = props;
|
|
15
|
+
const inputTextClass = inputText.size === 'small' ? style.smallInputText : style.defaultInputText;
|
|
15
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
17
|
className: style.container,
|
|
17
18
|
"data-name": dataName,
|
|
@@ -19,13 +20,14 @@ const InputTextWithTitle = props => {
|
|
|
19
20
|
}, /*#__PURE__*/React.createElement("span", {
|
|
20
21
|
className: style.title
|
|
21
22
|
}, title), /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
className:
|
|
23
|
+
className: inputTextClass
|
|
23
24
|
}, /*#__PURE__*/React.createElement(InputText, inputText)));
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
InputTextWithTitle.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
27
28
|
inputText: PropTypes.shape(_extends(_extends({}, InputText.propTypes), {}, {
|
|
28
|
-
theme: PropTypes.string
|
|
29
|
+
theme: PropTypes.string,
|
|
30
|
+
size: PropTypes.string
|
|
29
31
|
})),
|
|
30
32
|
title: PropTypes.string,
|
|
31
33
|
'aria-label': PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["React","PropTypes","InputText","style","InputTextWithTitle","props","inputText","title","dataName","ariaLabel","container","propTypes","shape","theme","string"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,SAAD;AAAYC,IAAAA,KAAZ;AAAmB,iBAAaC,QAAhC;AAA0C,kBAAcC;AAAxD,MAAqEJ,KAA3E;AAEA,sBACE;AAAK,IAAA,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["React","PropTypes","InputText","style","InputTextWithTitle","props","inputText","title","dataName","ariaLabel","inputTextClass","size","smallInputText","defaultInputText","container","propTypes","shape","theme","string"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,SAAD;AAAYC,IAAAA,KAAZ;AAAmB,iBAAaC,QAAhC;AAA0C,kBAAcC;AAAxD,MAAqEJ,KAA3E;AACA,QAAMK,cAAc,GAAGJ,SAAS,CAACK,IAAV,KAAmB,OAAnB,GAA6BR,KAAK,CAACS,cAAnC,GAAoDT,KAAK,CAACU,gBAAjF;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEV,KAAK,CAACW,SAAtB;AAAiC,iBAAWN,QAA5C;AAAsD,kBAAYC;AAAlE,kBACE;AAAM,IAAA,SAAS,EAAEN,KAAK,CAACI;AAAvB,KAA+BA,KAA/B,CADF,eAEE;AAAK,IAAA,SAAS,EAAEG;AAAhB,kBACE,oBAAC,SAAD,EAAeJ,SAAf,CADF,CAFF,CADF;AAQD,CAZD;;AAcAF,kBAAkB,CAACW,SAAnB,2CAA+B;AAC7BT,EAAAA,SAAS,EAAEL,SAAS,CAACe,KAAV,uBACNd,SAAS,CAACa,SADJ;AAETE,IAAAA,KAAK,EAAEhB,SAAS,CAACiB,MAFR;AAGTP,IAAAA,IAAI,EAAEV,SAAS,CAACiB;AAHP,KADkB;AAM7BX,EAAAA,KAAK,EAAEN,SAAS,CAACiB,MANY;AAO7B,gBAAcjB,SAAS,CAACiB,MAPK;AAQ7B,eAAajB,SAAS,CAACiB;AARM,CAA/B;AAUA,eAAed,kBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport InputText from '../input-text';\nimport style from './style.css';\n\nconst InputTextWithTitle = props => {\n const {inputText, title, 'data-name': dataName, 'aria-label': ariaLabel} = props;\n const inputTextClass = inputText.size === 'small' ? style.smallInputText : style.defaultInputText;\n\n return (\n <div className={style.container} data-name={dataName} aria-label={ariaLabel}>\n <span className={style.title}>{title}</span>\n <div className={inputTextClass}>\n <InputText {...inputText} />\n </div>\n </div>\n );\n};\n\nInputTextWithTitle.propTypes = {\n inputText: PropTypes.shape({\n ...InputText.propTypes,\n theme: PropTypes.string,\n size: PropTypes.string\n }),\n title: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\nexport default InputTextWithTitle;\n"],"file":"index.js"}
|