@ntbjs/react-components 1.3.0-rc.1 → 1.3.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{AssetGallery-8462760f.js → AssetGallery-7266af6d.js} +1 -1
- package/{Instructions-c5f3b7d6.js → Instructions-a3663a4e.js} +1 -1
- package/{TextArea-1da16eb4.js → TextArea-dd6da638.js} +47 -161
- package/inputs/TextArea/index.js +2 -2
- package/inputs/index.js +1 -1
- package/package.json +1 -1
- package/widgets/AssetGallery/index.js +2 -2
- package/widgets/Instructions/index.js +2 -2
- package/widgets/index.js +3 -3
|
@@ -24,7 +24,7 @@ require('./CompactStarRating-405e4508.js');
|
|
|
24
24
|
require('./CompactTextInput-0d53acdf.js');
|
|
25
25
|
require('./MultiSelect-efd60232.js');
|
|
26
26
|
require('./Radio-32d0513a.js');
|
|
27
|
-
require('./TextArea-
|
|
27
|
+
require('./TextArea-dd6da638.js');
|
|
28
28
|
require('./TextInput-0d109708.js');
|
|
29
29
|
require('./Switch-4a41585f.js');
|
|
30
30
|
var ContextMenu = require('./ContextMenu-4ec3d9f3.js');
|
|
@@ -5,7 +5,7 @@ var lodash = require('lodash');
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var warningCircle = require('./warning-circle-24522402.js');
|
|
7
7
|
var CompactAutocompleteSelect = require('./CompactAutocompleteSelect-b68618b3.js');
|
|
8
|
-
var TextArea = require('./TextArea-
|
|
8
|
+
var TextArea = require('./TextArea-dd6da638.js');
|
|
9
9
|
var styled = require('styled-components');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var defaultTheme = require('./defaultTheme-ea44e34a.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var useMergedRefs = require('./useMergedRefs-b6d2f8fc.js');
|
|
6
|
-
var lodash = require('lodash');
|
|
7
6
|
var nanoid = require('nanoid');
|
|
8
7
|
require('./Alert-13b75102.js');
|
|
9
8
|
require('./Badge-aec841c8.js');
|
|
@@ -20,7 +19,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
20
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
22
21
|
|
|
23
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43
|
|
22
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43;
|
|
24
23
|
var fadeInCheck = styled.keyframes(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n"])));
|
|
25
24
|
var fadeOutCheck = styled.keyframes(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n from {\n opacity: 1\n }\n to {\n opacity: 0\n }\n"])));
|
|
26
25
|
var activeLabel = styled.css(_templateObject3 || (_templateObject3 = defaultTheme._taggedTemplateLiteral(["\n font-size: 0.75rem;\n padding: 0 3px;\n top: -7px;\n letter-spacing: 0.03em;\n left: 8px !important;\n opacity: 1 !important;\n"])));
|
|
@@ -34,20 +33,16 @@ var InputIconContainer = styled__default['default'].div.attrs(defaultTheme.apply
|
|
|
34
33
|
}, function (props) {
|
|
35
34
|
return props.disabled && styled.css(_templateObject6 || (_templateObject6 = defaultTheme._taggedTemplateLiteral(["\n display: none;\n "])));
|
|
36
35
|
});
|
|
37
|
-
var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.applyDefaultTheme)(_templateObject7 || (_templateObject7 = defaultTheme._taggedTemplateLiteral(["\n width: 100%;\n font-family: inherit;\n font-size: 0.875rem;\n border-radius: 2px;\n padding: 5px 10px;\n resize: vertical;\n z-index: 0;\n border-radius: 3px;\n box-sizing: border-box;\n appearance: none;\n border: 1px solid;\n
|
|
38
|
-
return props.
|
|
39
|
-
}, function (props) {
|
|
40
|
-
return props.borderRadius && styled.css(_templateObject9 || (_templateObject9 = defaultTheme._taggedTemplateLiteral(["\n border-radius: ", "px;\n "])), props.borderRadius);
|
|
36
|
+
var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.applyDefaultTheme)(_templateObject7 || (_templateObject7 = defaultTheme._taggedTemplateLiteral(["\n width: 100%;\n font-family: inherit;\n font-size: 0.875rem;\n border-radius: 2px;\n padding: 5px 10px;\n resize: vertical;\n z-index: 0;\n border-radius: 3px;\n box-sizing: border-box;\n appearance: none;\n border: 1px solid;\n\n \n\n ", "\n\n \n \n\n transition: height 550ms ease-in-out; border-color 350ms;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n \n\n \n ", "\n\n ", "\n \n ", "\n\n ", "\n\n ", " \n\n ", " \n \n\n ", " \n\n \n \n ", "\n\n ", " \n\n ", "\n \n \n ", "\n\n ", "\n\n\n ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n\n\n &&:hover:not(:focus) {\n ", ";\n\n ", ";\n\n ", ";\n\n \n ", "; \n\n\n ", ";\n transition: background 350ms;\n & + ", " {\n opacity: 1;\n ", ";\n transition: opacity 350ms;\n }\n }\n\n &::placeholder {\n ", "\n\n ", "\n }\n\n &&:focus {\n outline: none;\n ", "\n\n ", ";\n\n \n ", " \n \n ", "\n\n }\n\n &&:not(:hover):not(:focus) {\n ", ";\n ", ";\n\n ", "\n\n ", ";\n\n \n }\n"])), function (props) {
|
|
37
|
+
return props.borderRadius && styled.css(_templateObject8 || (_templateObject8 = defaultTheme._taggedTemplateLiteral(["\n border-radius: ", "px;\n "])), props.borderRadius);
|
|
41
38
|
}, function (props) {
|
|
42
39
|
return props.theme.themeProp('color', 'white', 'black');
|
|
43
40
|
}, function (props) {
|
|
44
|
-
return props.readOnly && styled.css(
|
|
45
|
-
}, function (props) {
|
|
46
|
-
return props.disabled && styled.css(_templateObject11 || (_templateObject11 = defaultTheme._taggedTemplateLiteral(["\n cursor: not-allowed;\n "])));
|
|
41
|
+
return props.readOnly && styled.css(_templateObject9 || (_templateObject9 = defaultTheme._taggedTemplateLiteral(["\n cursor: default;\n border-color: transparent !important;\n "])));
|
|
47
42
|
}, function (props) {
|
|
48
|
-
return props.
|
|
43
|
+
return props.disabled && styled.css(_templateObject10 || (_templateObject10 = defaultTheme._taggedTemplateLiteral(["\n cursor: not-allowed;\n "])));
|
|
49
44
|
}, function (props) {
|
|
50
|
-
return props.
|
|
45
|
+
return props.readOnly && styled.css(_templateObject11 || (_templateObject11 = defaultTheme._taggedTemplateLiteral(["\n padding: 12px 10px; ;\n "])));
|
|
51
46
|
}, function (props) {
|
|
52
47
|
return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'));
|
|
53
48
|
}, function (props) {
|
|
@@ -57,39 +52,39 @@ var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.appl
|
|
|
57
52
|
}, function (props) {
|
|
58
53
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400'));
|
|
59
54
|
}, function (props) {
|
|
60
|
-
return props.noBorder && styled.css(
|
|
55
|
+
return props.noBorder && styled.css(_templateObject12 || (_templateObject12 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
61
56
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
62
57
|
});
|
|
63
58
|
}, function (props) {
|
|
64
|
-
return props.type === 'warning' && styled.css(
|
|
59
|
+
return props.type === 'warning' && styled.css(_templateObject13 || (_templateObject13 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), props.theme.themeProp('color', '#EAB308', 'black'), props.theme.themeProp('background', '#2F2402', '#F2D16B'), props.theme.themeProp('border-color', '#2F2402 ', '#F2D16B'));
|
|
65
60
|
}, function (props) {
|
|
66
|
-
return props.type === 'error' && styled.css(
|
|
61
|
+
return props.type === 'error' && styled.css(_templateObject14 || (_templateObject14 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), props.theme.themeProp('color', 'white', 'black'), props.theme.themeProp('background', '#7f1b1b', '#FBEAE6'), props.theme.themeProp('border-color', '#7f1b1b', '#FBEAE6'));
|
|
67
62
|
}, function (props) {
|
|
68
|
-
return props.noBorder && props.type === 'warning' && styled.css(
|
|
63
|
+
return props.noBorder && props.type === 'warning' && styled.css(_templateObject15 || (_templateObject15 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
69
64
|
return props.theme.themeProp('border-color', '#2F2402', '#F2D16B');
|
|
70
65
|
});
|
|
71
66
|
}, function (props) {
|
|
72
|
-
return props.noBorder && props.type === 'error' && styled.css(
|
|
67
|
+
return props.noBorder && props.type === 'error' && styled.css(_templateObject16 || (_templateObject16 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
73
68
|
return props.theme.themeProp('border-color', '#7f1b1b', '#FBEAE6');
|
|
74
69
|
});
|
|
75
70
|
}, function (props) {
|
|
76
|
-
return props.type === 'warning-border' && styled.css(
|
|
71
|
+
return props.type === 'warning-border' && styled.css(_templateObject17 || (_templateObject17 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('border-color', props.theme.getColor('red-200'), props.theme.getColor('orange-500')));
|
|
77
72
|
}, function (props) {
|
|
78
|
-
return props.type === 'error-border' && styled.css(
|
|
73
|
+
return props.type === 'error-border' && styled.css(_templateObject18 || (_templateObject18 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('border-color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
79
74
|
}, function (props) {
|
|
80
|
-
return props.lightBackground && styled.css(
|
|
75
|
+
return props.lightBackground && styled.css(_templateObject19 || (_templateObject19 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n &&:hover {\n ", "\n }\n "])), props.theme.themeProp('background', '#FFFDDE', '#fffde8'), props.theme.themeProp('color', props.theme.getColor('gray-900'), props.theme.getColor('gray-900')), props.theme.themeProp('background', 'white', 'white'));
|
|
81
76
|
}, function (props) {
|
|
82
77
|
return props.edit && props.type != 'warning' && props.theme.themeProp('background', '#505050', '#eff1f4');
|
|
83
78
|
}, function (props) {
|
|
84
79
|
return props.edit && props.type === 'warning' && props.theme.themeProp('background', '#AD8800', '#FFF3A7');
|
|
85
80
|
}, function (props) {
|
|
86
|
-
return props.padding === 'small' && styled.css(
|
|
81
|
+
return props.padding === 'small' && styled.css(_templateObject20 || (_templateObject20 = defaultTheme._taggedTemplateLiteral(["\n padding: 5px 10px;\n "])));
|
|
87
82
|
}, function (props) {
|
|
88
|
-
return props.padding === 'medium' && styled.css(
|
|
83
|
+
return props.padding === 'medium' && styled.css(_templateObject21 || (_templateObject21 = defaultTheme._taggedTemplateLiteral(["\n padding: 13px 15px;\n "])));
|
|
89
84
|
}, function (props) {
|
|
90
|
-
return props.padding === 'large' && styled.css(
|
|
85
|
+
return props.padding === 'large' && styled.css(_templateObject22 || (_templateObject22 = defaultTheme._taggedTemplateLiteral(["\n padding: 15px 55px;\n "])));
|
|
91
86
|
}, function (props) {
|
|
92
|
-
return props.hasIcon && styled.css(
|
|
87
|
+
return props.hasIcon && styled.css(_templateObject23 || (_templateObject23 = defaultTheme._taggedTemplateLiteral(["\n padding-left: 55px;\n padding-right: 35px;\n padding-top: 13.5px;\n "])));
|
|
93
88
|
}, function (props) {
|
|
94
89
|
return !props.readOnly && !props.disabled && props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100'));
|
|
95
90
|
}, function (props) {
|
|
@@ -101,7 +96,7 @@ var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.appl
|
|
|
101
96
|
}, function (props) {
|
|
102
97
|
return props.noBorder && !props.readOnly && props.type != 'warning' && props.type != 'error' ? props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100')) : 'background: transparent';
|
|
103
98
|
}, InputIconContainer, function (props) {
|
|
104
|
-
return props.type === 'success' && styled.css(
|
|
99
|
+
return props.type === 'success' && styled.css(_templateObject24 || (_templateObject24 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0;\n "])));
|
|
105
100
|
}, function (props) {
|
|
106
101
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'), 1);
|
|
107
102
|
}, function (props) {
|
|
@@ -111,11 +106,11 @@ var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.appl
|
|
|
111
106
|
}, function (props) {
|
|
112
107
|
return props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white'));
|
|
113
108
|
}, function (props) {
|
|
114
|
-
return props.type === 'warning' && styled.css(
|
|
109
|
+
return props.type === 'warning' && styled.css(_templateObject25 || (_templateObject25 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), function (props) {
|
|
115
110
|
return props.theme.themeProp('border-color', '#F4E21E', '#F4E21E');
|
|
116
111
|
}, props.theme.themeProp('background', 'white', 'white'), props.theme.themeProp('color', 'black', 'black'));
|
|
117
112
|
}, function (props) {
|
|
118
|
-
return props.type === 'error' && styled.css(
|
|
113
|
+
return props.type === 'error' && styled.css(_templateObject26 || (_templateObject26 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), function (props) {
|
|
119
114
|
return props.theme.themeProp('border-color', '#D83018', '#D83018');
|
|
120
115
|
}, props.theme.themeProp('background', 'white', 'white'), props.theme.themeProp('color', 'black', 'black'));
|
|
121
116
|
}, function (props) {
|
|
@@ -123,56 +118,56 @@ var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.appl
|
|
|
123
118
|
}, function (props) {
|
|
124
119
|
return props.edit && props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)');
|
|
125
120
|
}, function (props) {
|
|
126
|
-
return props.noBorder && props.edit && styled.css(
|
|
121
|
+
return props.noBorder && props.edit && styled.css(_templateObject27 || (_templateObject27 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
127
122
|
return props.theme.themeProp('border-color', '#27272A', 'rgba(244,244,245, 0.3)');
|
|
128
123
|
});
|
|
129
124
|
}, function (props) {
|
|
130
125
|
return props.edit && props.type === 'warning' && props.theme.themeProp('background', '#2F2402', '#FFF3A7');
|
|
131
126
|
});
|
|
132
|
-
var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(
|
|
127
|
+
var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(_templateObject28 || (_templateObject28 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n top: 13px;\n left: 11px;\n line-height: 1.2;\n font-size: 0.875rem;\n transition: all 150ms;\n margin-botton: 50px;\n\n ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n content: \"\";\n\n ", "\n"])), function (props) {
|
|
133
128
|
return props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'));
|
|
134
129
|
}, placeholderBaseStyle, function (props) {
|
|
135
130
|
return props.theme.themeProp('background', "linear-gradient(0deg, ".concat(props.theme.getColor('gray-900'), " calc(50% + 1px), transparent 50%)"), "linear-gradient(0deg, ".concat(props.theme.getColor('white'), " calc(50% + 1px), transparent 50%)"));
|
|
136
131
|
}, function (props) {
|
|
137
|
-
return !props.inputIsEmpty && styled.css(
|
|
132
|
+
return !props.inputIsEmpty && styled.css(_templateObject29 || (_templateObject29 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), activeLabel);
|
|
138
133
|
}, function (props) {
|
|
139
|
-
return props.hasPlaceholder && styled.css(
|
|
134
|
+
return props.hasPlaceholder && styled.css(_templateObject30 || (_templateObject30 = defaultTheme._taggedTemplateLiteral(["\n ", ";\n "])), activeLabel);
|
|
140
135
|
}, function (props) {
|
|
141
|
-
return props.hasIcon && styled.css(
|
|
136
|
+
return props.hasIcon && styled.css(_templateObject31 || (_templateObject31 = defaultTheme._taggedTemplateLiteral(["\n left: 55px;\n "])));
|
|
142
137
|
});
|
|
143
|
-
var TextInputFieldIcon = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(
|
|
144
|
-
var TextInputFieldIconAlert = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(
|
|
138
|
+
var TextInputFieldIcon = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject32 || (_templateObject32 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n height: 2.625rem;\n display: flex;\n padding: 0 10px;\n\n svg {\n width: 15px;\n opacity: 0.6;\n transition: opacity 250ms;\n }\n"])));
|
|
139
|
+
var TextInputFieldIconAlert = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject33 || (_templateObject33 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n top: 2.8px;\n display: flex;\n padding: 0 10px 0 30px;\n opacity: 0.6;\n transition: opacity 250ms;\n ", "\n svg {\n margin-top: 12px;\n width: 15px;\n }\n"])), function (props) {
|
|
145
140
|
return props.type === 'warning' && props.theme.themeProp('color', '#EAB308', '#2F2402');
|
|
146
141
|
});
|
|
147
|
-
var TextInput = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(
|
|
148
|
-
return props.readOnly && styled.css(
|
|
142
|
+
var TextInput = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject34 || (_templateObject34 = defaultTheme._taggedTemplateLiteral(["\n position: relative;\n\n ", "\n\n ", "\n\n &:focus-within {\n ", " {\n ", ";\n }\n\n ", " {\n svg {\n opacity: 1;\n }\n }\n }\n\n ", ":not(:placeholder-shown) + ", " {\n ", ";\n ", "\n }\n }\n"])), function (props) {
|
|
143
|
+
return props.readOnly && styled.css(_templateObject35 || (_templateObject35 = defaultTheme._taggedTemplateLiteral(["\n pointer-events: none;\n "])));
|
|
149
144
|
}, function (props) {
|
|
150
|
-
return props.disabled && styled.css(
|
|
145
|
+
return props.disabled && styled.css(_templateObject36 || (_templateObject36 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0.5;\n\n > * {\n cursor: not-allowed;\n }\n "])));
|
|
151
146
|
}, TextInputLabel, activeLabel, TextInputFieldIcon, TextInputField, TextInputLabel, activeLabel, function (props) {
|
|
152
147
|
return props.type === 'error' && props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500'));
|
|
153
148
|
});
|
|
154
|
-
var Description = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(
|
|
149
|
+
var Description = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject37 || (_templateObject37 = defaultTheme._taggedTemplateLiteral(["\n margin: 8px 0 0 0;\n padding: 0 0.6875rem;\n font-size: 0.75rem;\n line-height: 1.333;\n\n ", ";\n\n ", "\n\n ", "\n"])), function (props) {
|
|
155
150
|
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'));
|
|
156
151
|
}, function (props) {
|
|
157
|
-
return (props.type === 'warning-border' || props.type === 'warning') && styled.css(
|
|
152
|
+
return (props.type === 'warning-border' || props.type === 'warning') && styled.css(_templateObject38 || (_templateObject38 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('orange-500')));
|
|
158
153
|
}, function (props) {
|
|
159
|
-
return (props.type === 'error-border' || props.type === 'error') && styled.css(
|
|
154
|
+
return (props.type === 'error-border' || props.type === 'error') && styled.css(_templateObject39 || (_templateObject39 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
160
155
|
});
|
|
161
|
-
var SuccessContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(
|
|
156
|
+
var SuccessContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject40 || (_templateObject40 = defaultTheme._taggedTemplateLiteral(["\n opacity: 1;\n pointer-events: none;\n opacity: ", ";\n animation: ", " 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n position: absolute;\n margin-top: -35px;\n margin-left: 5px;\n width: 15px;\n height: 15px;\n padding: 5px;\n ", "\n\n > svg {\n width: 15px;\n }\n"])), function (props) {
|
|
162
157
|
return props.fadeIn ? 0 : 1;
|
|
163
158
|
}, function (props) {
|
|
164
159
|
return props.fadeIn ? fadeOutCheck : fadeInCheck;
|
|
165
160
|
}, function (props) {
|
|
166
161
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'));
|
|
167
162
|
});
|
|
168
|
-
|
|
169
|
-
return props.expanded && styled.css(
|
|
163
|
+
styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject41 || (_templateObject41 = defaultTheme._taggedTemplateLiteral(["\n margin-top: -18px;\n margin-bottom: 0;\n display: block;\n position: absolute;\n font-size: 0.875rem;\n cursor: pointer;\n padding: 2px 10px;\n margin-right: 10px;\n margin-top: -26px;\n ", "\n transition: margin-top 550ms ease-in-out;\n -webkit-mask-image: linear-gradient(180deg, transparent 1px, white 7px);\n ", "\n\n ", ";\n\n ", "\n"])), function (props) {
|
|
164
|
+
return props.expanded && styled.css(_templateObject42 || (_templateObject42 = defaultTheme._taggedTemplateLiteral(["\n margin-top: 0px;\n "])));
|
|
170
165
|
}, function (props) {
|
|
171
166
|
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
172
167
|
}, function (props) {
|
|
173
168
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('emerald-500'));
|
|
174
169
|
}, function (props) {
|
|
175
|
-
return props.type === 'error' && styled.css(
|
|
170
|
+
return props.type === 'error' && styled.css(_templateObject43 || (_templateObject43 = defaultTheme._taggedTemplateLiteral(["\n content: 'error';\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
176
171
|
});
|
|
177
172
|
|
|
178
173
|
var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forwardedRef) {
|
|
@@ -186,9 +181,6 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
186
181
|
hidden = _ref.hidden,
|
|
187
182
|
readOnly = _ref.readOnly,
|
|
188
183
|
edit = _ref.edit,
|
|
189
|
-
showMore = _ref.showMore,
|
|
190
|
-
showMoreText = _ref.showMoreText,
|
|
191
|
-
showLessText = _ref.showLessText,
|
|
192
184
|
autoComplete = _ref.autoComplete,
|
|
193
185
|
description = _ref.description,
|
|
194
186
|
type = _ref.type,
|
|
@@ -201,13 +193,12 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
201
193
|
lightBackground = _ref.lightBackground,
|
|
202
194
|
noBorder = _ref.noBorder,
|
|
203
195
|
instructionsTextArea = _ref.instructionsTextArea,
|
|
204
|
-
isExpanded = _ref.isExpanded,
|
|
205
196
|
loadingIcon = _ref.loadingIcon,
|
|
206
197
|
successIcon = _ref.successIcon,
|
|
207
198
|
padding = _ref.padding,
|
|
208
199
|
descriptionToolTip = _ref.descriptionToolTip,
|
|
209
200
|
borderRadius = _ref.borderRadius,
|
|
210
|
-
rest = defaultTheme._objectWithoutProperties(_ref, ["value", "defaultValue", "name", "label", "placeholder", "required", "disabled", "hidden", "readOnly", "edit", "
|
|
201
|
+
rest = defaultTheme._objectWithoutProperties(_ref, ["value", "defaultValue", "name", "label", "placeholder", "required", "disabled", "hidden", "readOnly", "edit", "autoComplete", "description", "type", "icon", "rows", "className", "style", "onChange", "onBlur", "lightBackground", "noBorder", "instructionsTextArea", "loadingIcon", "successIcon", "padding", "descriptionToolTip", "borderRadius"]);
|
|
211
202
|
|
|
212
203
|
var textInputDomNode = React.useRef(null);
|
|
213
204
|
var textInputRef = useMergedRefs.useMergedRefs(forwardedRef, textInputDomNode);
|
|
@@ -217,112 +208,27 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
217
208
|
inputIsEmpty = _useState2[0],
|
|
218
209
|
setInputIsEmpty = _useState2[1];
|
|
219
210
|
|
|
220
|
-
var _useState3 = React.useState(
|
|
211
|
+
var _useState3 = React.useState(false),
|
|
221
212
|
_useState4 = defaultTheme._slicedToArray(_useState3, 2),
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
var _useState5 = React.useState(false),
|
|
226
|
-
_useState6 = defaultTheme._slicedToArray(_useState5, 2),
|
|
227
|
-
expanded = _useState6[0],
|
|
228
|
-
setExpanded = _useState6[1];
|
|
229
|
-
|
|
230
|
-
var _useState7 = React.useState(''),
|
|
231
|
-
_useState8 = defaultTheme._slicedToArray(_useState7, 2),
|
|
232
|
-
maxHeight = _useState8[0],
|
|
233
|
-
setMaxHeight = _useState8[1];
|
|
213
|
+
autoFocus = _useState4[0],
|
|
214
|
+
setAutoFocus = _useState4[1];
|
|
234
215
|
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
setDefaultHeight = _useState10[1];
|
|
239
|
-
|
|
240
|
-
var _useState11 = React.useState(false),
|
|
241
|
-
_useState12 = defaultTheme._slicedToArray(_useState11, 2),
|
|
242
|
-
autoFocus = _useState12[0],
|
|
243
|
-
setAutoFocus = _useState12[1];
|
|
244
|
-
|
|
245
|
-
var _useState13 = React.useState(false),
|
|
246
|
-
_useState14 = defaultTheme._slicedToArray(_useState13, 2),
|
|
247
|
-
isInputHeightMore = _useState14[0],
|
|
248
|
-
setIsInputHeightMore = _useState14[1];
|
|
249
|
-
|
|
250
|
-
var _useState15 = React.useState(nanoid.nanoid()),
|
|
251
|
-
_useState16 = defaultTheme._slicedToArray(_useState15, 1),
|
|
252
|
-
uniqueId = _useState16[0];
|
|
216
|
+
var _useState5 = React.useState(nanoid.nanoid()),
|
|
217
|
+
_useState6 = defaultTheme._slicedToArray(_useState5, 1),
|
|
218
|
+
uniqueId = _useState6[0];
|
|
253
219
|
|
|
254
220
|
var memoizedDescriptionToolTip = React.useMemo(function () {
|
|
255
221
|
return descriptionToolTip;
|
|
256
222
|
}, [descriptionToolTip]);
|
|
257
223
|
React.useEffect(function () {
|
|
258
|
-
if (lodash.isEmpty(value) || lodash.isEmpty(defaultValue)) {
|
|
259
|
-
setExpanded(false);
|
|
260
|
-
}
|
|
261
|
-
}, [value, defaultValue]);
|
|
262
|
-
React.useEffect(function () {
|
|
263
|
-
setExpanded(false);
|
|
264
|
-
isExpanded(false);
|
|
265
224
|
setAutoFocus(false);
|
|
266
225
|
}, [value, defaultValue]);
|
|
267
|
-
|
|
268
|
-
var handleTextAreaChange = function handleTextAreaChange() {
|
|
269
|
-
setExpanded(true);
|
|
270
|
-
isExpanded(true);
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
var handleTextAreaShowLess = function handleTextAreaShowLess() {
|
|
274
|
-
setExpanded(!expanded);
|
|
275
|
-
isExpanded(!expanded);
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
var calculateRows = function calculateRows() {
|
|
279
|
-
var textareaRefCurrent = textInputDomNode === null || textInputDomNode === void 0 ? void 0 : textInputDomNode.current;
|
|
280
|
-
|
|
281
|
-
if (textareaRefCurrent !== null) {
|
|
282
|
-
var textAreaHeight = textareaRefCurrent === null || textareaRefCurrent === void 0 ? void 0 : textareaRefCurrent.scrollHeight;
|
|
283
|
-
var lineHeight = 12;
|
|
284
|
-
var calculatedRows = Math.floor(textAreaHeight / lineHeight);
|
|
285
|
-
var defaultRowsHeight = rows * 20;
|
|
286
|
-
setMaxContentRows(calculatedRows);
|
|
287
|
-
|
|
288
|
-
if (calculatedRows > rows) {
|
|
289
|
-
setDefaultHeight(defaultRowsHeight);
|
|
290
|
-
setMaxHeight(textAreaHeight);
|
|
291
|
-
} else {
|
|
292
|
-
setMaxHeight();
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
React.useEffect(function () {
|
|
298
|
-
calculateRows();
|
|
299
|
-
}, [value, defaultValue]);
|
|
300
226
|
var onKeyDown = React.useCallback(function (event) {
|
|
301
227
|
if (event.key === 'Enter') {
|
|
302
228
|
event.stopPropagation();
|
|
303
229
|
}
|
|
304
230
|
}, []);
|
|
305
231
|
|
|
306
|
-
var onChangeHeight = function onChangeHeight(e) {
|
|
307
|
-
var textareaRefCurrent = textInputDomNode === null || textInputDomNode === void 0 ? void 0 : textInputDomNode.current;
|
|
308
|
-
var newValue = e.target.value;
|
|
309
|
-
|
|
310
|
-
if (textareaRefCurrent !== null) {
|
|
311
|
-
textareaRefCurrent.value = newValue;
|
|
312
|
-
var heightOnInput = textareaRefCurrent === null || textareaRefCurrent === void 0 ? void 0 : textareaRefCurrent.scrollHeight;
|
|
313
|
-
var defaultRowsHeight = rows * 20;
|
|
314
|
-
|
|
315
|
-
if (heightOnInput > defaultRowsHeight) {
|
|
316
|
-
setMaxHeight(heightOnInput);
|
|
317
|
-
setIsInputHeightMore(false);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
if (heightOnInput < defaultHeight) {
|
|
321
|
-
setIsInputHeightMore(true);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
|
|
326
232
|
var input = function input() {
|
|
327
233
|
return React__default['default'].createElement(TextInput, {
|
|
328
234
|
disabled: disabled,
|
|
@@ -333,16 +239,10 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
333
239
|
}, React__default['default'].createElement(TextInputFieldIconAlert, {
|
|
334
240
|
type: type
|
|
335
241
|
}, icon), React__default['default'].createElement(TextInputField, defaultTheme._extends({
|
|
336
|
-
style: {
|
|
337
|
-
height: expanded ? "".concat(maxHeight, "px") : "".concat(defaultHeight, "px")
|
|
338
|
-
},
|
|
339
242
|
autoFocus: autoFocus,
|
|
340
243
|
borderRadius: borderRadius,
|
|
341
244
|
ref: textInputRef,
|
|
342
245
|
rows: rows,
|
|
343
|
-
expanded: expanded,
|
|
344
|
-
defaultHeight: defaultHeight,
|
|
345
|
-
maxHeight: maxHeight,
|
|
346
246
|
value: value,
|
|
347
247
|
defaultValue: defaultValue,
|
|
348
248
|
name: name,
|
|
@@ -352,7 +252,6 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
352
252
|
disabled: disabled,
|
|
353
253
|
edit: edit,
|
|
354
254
|
instructionsTextArea: instructionsTextArea,
|
|
355
|
-
showMore: showMore,
|
|
356
255
|
type: type,
|
|
357
256
|
autoComplete: autoComplete,
|
|
358
257
|
hasIcon: Boolean(icon),
|
|
@@ -377,15 +276,11 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
377
276
|
}
|
|
378
277
|
|
|
379
278
|
_onChange(e);
|
|
380
|
-
|
|
381
|
-
onChangeHeight(e);
|
|
382
279
|
},
|
|
383
280
|
onKeyDown: onKeyDown,
|
|
384
281
|
onBlur: onBlur,
|
|
385
282
|
noBorder: noBorder
|
|
386
|
-
}, rest, {
|
|
387
|
-
onClick: showMore ? handleTextAreaChange : undefined
|
|
388
|
-
})), (type === 'loading' || type === 'success') && React__default['default'].createElement(SuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon), !readOnly && noBorder && React__default['default'].createElement(InputIconContainer, {
|
|
283
|
+
}, rest)), (type === 'loading' || type === 'success') && React__default['default'].createElement(SuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon), !readOnly && noBorder && React__default['default'].createElement(InputIconContainer, {
|
|
389
284
|
disabled: disabled
|
|
390
285
|
}, React__default['default'].createElement(editNote.SvgEditNote, {
|
|
391
286
|
className: padding === 'small' ? 'smallPadingIcon' : undefined
|
|
@@ -396,10 +291,7 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
396
291
|
inputIsEmpty: inputIsEmpty
|
|
397
292
|
}, label, required && ' *'), typeof description === 'string' && description.length > 0 && React__default['default'].createElement(Description, {
|
|
398
293
|
type: type
|
|
399
|
-
}, description)
|
|
400
|
-
onClick: showMore ? handleTextAreaShowLess : undefined,
|
|
401
|
-
expanded: expanded
|
|
402
|
-
}, !expanded ? showMoreText : showLessText));
|
|
294
|
+
}, description));
|
|
403
295
|
};
|
|
404
296
|
|
|
405
297
|
if (hidden) return null;
|
|
@@ -417,9 +309,6 @@ TextArea.defaultProps = {
|
|
|
417
309
|
readOnly: false,
|
|
418
310
|
edit: false,
|
|
419
311
|
hidden: false,
|
|
420
|
-
showMore: false,
|
|
421
|
-
showMoreText: '',
|
|
422
|
-
showLessText: '',
|
|
423
312
|
type: '',
|
|
424
313
|
padding: 'medium',
|
|
425
314
|
instructionsTextArea: false,
|
|
@@ -438,9 +327,6 @@ TextArea.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
438
327
|
disabled: defaultTheme.PropTypes.bool,
|
|
439
328
|
hidden: defaultTheme.PropTypes.bool,
|
|
440
329
|
readOnly: defaultTheme.PropTypes.bool,
|
|
441
|
-
showMore: defaultTheme.PropTypes.bool,
|
|
442
|
-
showMoreText: defaultTheme.PropTypes.string,
|
|
443
|
-
showLessText: defaultTheme.PropTypes.string,
|
|
444
330
|
edit: defaultTheme.PropTypes.bool,
|
|
445
331
|
autoComplete: defaultTheme.PropTypes.string,
|
|
446
332
|
description: defaultTheme.PropTypes.string,
|
package/inputs/TextArea/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var TextArea = require('../../TextArea-
|
|
3
|
+
var TextArea = require('../../TextArea-dd6da638.js');
|
|
4
4
|
require('../../defaultTheme-ea44e34a.js');
|
|
5
5
|
require('styled-components');
|
|
6
6
|
require('react');
|
|
7
7
|
require('../../useMergedRefs-b6d2f8fc.js');
|
|
8
|
-
require('lodash');
|
|
9
8
|
require('nanoid');
|
|
10
9
|
require('../../Alert-13b75102.js');
|
|
10
|
+
require('lodash');
|
|
11
11
|
require('../../Badge-aec841c8.js');
|
|
12
12
|
require('../../Popover-569cd272.js');
|
|
13
13
|
require('polished');
|
package/inputs/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var CompactStarRating = require('../CompactStarRating-405e4508.js');
|
|
|
10
10
|
var CompactTextInput = require('../CompactTextInput-0d53acdf.js');
|
|
11
11
|
var MultiSelect = require('../MultiSelect-efd60232.js');
|
|
12
12
|
var Radio = require('../Radio-32d0513a.js');
|
|
13
|
-
var TextArea = require('../TextArea-
|
|
13
|
+
var TextArea = require('../TextArea-dd6da638.js');
|
|
14
14
|
var TextInput = require('../TextInput-0d109708.js');
|
|
15
15
|
var Switch = require('../Switch-4a41585f.js');
|
|
16
16
|
var MultiLevelCheckboxSelect = require('../MultiLevelCheckboxSelect-f3de8047.js');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var AssetGallery = require('../../AssetGallery-
|
|
3
|
+
var AssetGallery = require('../../AssetGallery-7266af6d.js');
|
|
4
4
|
require('../../defaultTheme-ea44e34a.js');
|
|
5
5
|
require('styled-components');
|
|
6
6
|
require('lodash');
|
|
@@ -41,7 +41,7 @@ require('../../CompactStarRating-405e4508.js');
|
|
|
41
41
|
require('../../CompactTextInput-0d53acdf.js');
|
|
42
42
|
require('../../MultiSelect-efd60232.js');
|
|
43
43
|
require('../../Radio-32d0513a.js');
|
|
44
|
-
require('../../TextArea-
|
|
44
|
+
require('../../TextArea-dd6da638.js');
|
|
45
45
|
require('../../Switch-4a41585f.js');
|
|
46
46
|
require('../../ContextMenuItem-ba2b697e.js');
|
|
47
47
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Instructions = require('../../Instructions-
|
|
3
|
+
var Instructions = require('../../Instructions-a3663a4e.js');
|
|
4
4
|
require('../../defaultTheme-ea44e34a.js');
|
|
5
5
|
require('styled-components');
|
|
6
6
|
require('lodash');
|
|
@@ -25,7 +25,7 @@ require('../../react-select-creatable.esm-2f23d6c6.js');
|
|
|
25
25
|
require('react-dom');
|
|
26
26
|
require('../../close-ebf2f3cf.js');
|
|
27
27
|
require('../../expand-more-94585605.js');
|
|
28
|
-
require('../../TextArea-
|
|
28
|
+
require('../../TextArea-dd6da638.js');
|
|
29
29
|
require('../../useMergedRefs-b6d2f8fc.js');
|
|
30
30
|
require('../../edit-note-c47d292e.js');
|
|
31
31
|
|
package/widgets/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var AssetGallery = require('../AssetGallery-
|
|
5
|
+
var AssetGallery = require('../AssetGallery-7266af6d.js');
|
|
6
6
|
var ContextMenu = require('../ContextMenu-4ec3d9f3.js');
|
|
7
7
|
var AssetPreviewTopBar = require('../AssetPreviewTopBar-912c3469.js');
|
|
8
|
-
var Instructions = require('../Instructions-
|
|
8
|
+
var Instructions = require('../Instructions-a3663a4e.js');
|
|
9
9
|
require('../defaultTheme-ea44e34a.js');
|
|
10
10
|
require('styled-components');
|
|
11
11
|
require('lodash');
|
|
@@ -45,7 +45,7 @@ require('../CompactStarRating-405e4508.js');
|
|
|
45
45
|
require('../CompactTextInput-0d53acdf.js');
|
|
46
46
|
require('../MultiSelect-efd60232.js');
|
|
47
47
|
require('../Radio-32d0513a.js');
|
|
48
|
-
require('../TextArea-
|
|
48
|
+
require('../TextArea-dd6da638.js');
|
|
49
49
|
require('../Switch-4a41585f.js');
|
|
50
50
|
require('../ContextMenuItem-ba2b697e.js');
|
|
51
51
|
|