@ntbjs/react-components 1.3.0-rc.59 → 1.3.0-rc.6-patch.1
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/.eslintrc +8 -7
- package/{ActionButton-b2345555.js → ActionButton-dea072f4.js} +16 -19
- package/{Alert-d69a3f95.js → Alert-347a66eb.js} +24 -20
- package/{AssetAction-9622c4f9.js → AssetGallery-f24a8bb1.js} +651 -606
- package/AssetPreviewTopBar-b64d4665.js +99 -0
- package/{Badge-e984e6f5.js → Badge-b5d734ce.js} +49 -28
- package/{Button-090fb526.js → Button-211d92ec.js} +85 -94
- package/{Checkbox-ad9c9e54.js → Checkbox-b6f6fabf.js} +35 -30
- package/{CompactAutocompleteSelect-26949125.js → CompactAutocompleteSelect-15a10abb.js} +114 -82
- package/{CompactStarRating-65bf27e5.js → CompactStarRating-821494e0.js} +94 -83
- package/{CompactTextInput-60edc635.js → CompactTextInput-ca8a67af.js} +106 -110
- package/{ContextMenu-4eb8fdc5.js → ContextMenu-d269f2b4.js} +6 -6
- package/{ContextMenuItem-c536b460.js → ContextMenuItem-960e1acf.js} +26 -22
- package/{InputGroup-a89a0ea3.js → InputGroup-b5ebae07.js} +6 -6
- package/{Instructions-dbd4514c.js → Instructions-6bfa0f6e.js} +81 -97
- package/{MultiLevelCheckboxSelect-3d5d5f2c.js → MultiLevelCheckboxSelect-b145322d.js} +164 -102
- package/{MultiSelect-cdfe6ffa.js → MultiSelect-b2459602.js} +101 -71
- package/{Popover-52d29ca6.js → Popover-ec433aaf.js} +40 -41
- package/{Radio-55db4781.js → Radio-2ab61f91.js} +22 -21
- package/{SectionSeparator-af8dc1ce.js → SectionSeparator-a28c6af2.js} +6 -6
- package/{Switch-04ecd8d0.js → Switch-e3289575.js} +27 -25
- package/{Tab-e43241f0.js → Tab-91278790.js} +7 -7
- package/{Tabs-cfc08c6b.js → Tabs-2a0f1d84.js} +43 -39
- package/{TextArea-44b4d3c4.js → TextArea-8c8757d9.js} +125 -93
- package/{TextInput-c3c71881.js → TextInput-4cac4342.js} +50 -48
- package/{Tooltip-a68a7e49.js → Tooltip-978b6cdd.js} +13 -13
- package/{VerificationStatusIcon-7b0e23fe.js → VerificationStatusIcon-ad0159e3.js} +30 -20
- package/{close-1751121a.js → close-ebf2f3cf.js} +12 -8
- package/data/Alert/index.js +2 -2
- package/data/Badge/index.js +2 -2
- package/data/Popover/index.js +3 -3
- package/data/Tab/index.js +2 -2
- package/data/Tabs/index.js +3 -3
- package/data/Tooltip/index.js +3 -3
- package/data/index.js +9 -9
- package/{defaultTheme-cd01e6c2.js → defaultTheme-44832997.js} +261 -213
- package/edit-note-c47d292e.js +41 -0
- package/{expand-more-d74e2bd2.js → expand-more-94585605.js} +12 -8
- package/inputs/ActionButton/index.js +2 -2
- package/inputs/Button/index.js +6 -6
- package/inputs/Checkbox/index.js +2 -2
- package/inputs/CompactAutocompleteSelect/index.js +13 -13
- package/inputs/CompactStarRating/index.js +10 -10
- package/inputs/CompactTextInput/index.js +11 -11
- package/inputs/MultiSelect/index.js +4 -4
- package/inputs/Radio/index.js +2 -2
- package/inputs/Switch/index.js +2 -2
- package/inputs/TextArea/index.js +11 -11
- package/inputs/TextInput/index.js +3 -3
- package/inputs/index.js +28 -28
- package/layout/InputGroup/index.js +2 -2
- package/layout/SectionSeparator/index.js +2 -2
- package/layout/index.js +3 -3
- package/package.json +1 -2
- package/{react-select-creatable.esm-383b1e78.js → react-select-creatable.esm-2f23d6c6.js} +1285 -1414
- package/{shift-away-subtle-631cd794.js → shift-away-subtle-22739ae8.js} +1 -1
- package/ssr/index.js +3 -1
- package/styles/config.scss +2 -2
- package/warning-circle-24522402.js +41 -0
- package/widgets/AssetGallery/index.js +32 -34
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +3 -3
- package/widgets/ContextMenu/ContextMenuItem/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +6 -6
- package/widgets/ContextMenu/index.js +2 -2
- package/widgets/Instructions/index.js +17 -16
- package/widgets/index.js +35 -37
- package/AssetPreviewTopBar-b1fe3188.js +0 -104
- package/edit-note-cefe2215.js +0 -37
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-44832997.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var lodash = require('lodash');
|
|
6
6
|
var useMergedRefs = require('./useMergedRefs-b6d2f8fc.js');
|
|
7
7
|
var nanoid = require('nanoid');
|
|
8
|
-
require('./Alert-
|
|
9
|
-
require('./Badge-
|
|
10
|
-
require('./Popover-
|
|
11
|
-
require('./Tab-
|
|
12
|
-
require('./Tabs-
|
|
13
|
-
var Tooltip = require('./Tooltip-
|
|
14
|
-
require('./VerificationStatusIcon-
|
|
15
|
-
var editNote = require('./edit-note-
|
|
8
|
+
require('./Alert-347a66eb.js');
|
|
9
|
+
require('./Badge-b5d734ce.js');
|
|
10
|
+
require('./Popover-ec433aaf.js');
|
|
11
|
+
require('./Tab-91278790.js');
|
|
12
|
+
require('./Tabs-2a0f1d84.js');
|
|
13
|
+
var Tooltip = require('./Tooltip-978b6cdd.js');
|
|
14
|
+
require('./VerificationStatusIcon-ad0159e3.js');
|
|
15
|
+
var editNote = require('./edit-note-c47d292e.js');
|
|
16
16
|
var styled = require('styled-components');
|
|
17
17
|
|
|
18
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -20,64 +20,70 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
21
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
22
22
|
|
|
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, _templateObject44;
|
|
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, _templateObject44, _templateObject45, _templateObject46, _templateObject47;
|
|
24
24
|
var fadeInCheck = styled.keyframes(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n"])));
|
|
25
25
|
var fadeOutCheck = styled.keyframes(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n from {\n opacity: 1\n }\n to {\n opacity: 0\n }\n"])));
|
|
26
26
|
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"])));
|
|
27
|
-
var placeholderBaseStyle = styled.css(_templateObject4 || (_templateObject4 = defaultTheme._taggedTemplateLiteral(["\n ", "\n\n ", "\n
|
|
28
|
-
return props.theme.themeProp('color', props.theme.getColor('
|
|
29
|
-
}, function (props) {
|
|
30
|
-
return props.type === 'error-border' && styled.css(_templateObject5 || (_templateObject5 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-500'), props.theme.getColor('red-500')));
|
|
31
|
-
}, function (props) {
|
|
32
|
-
return props.type === 'warning-border' && styled.css(_templateObject6 || (_templateObject6 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('orange-500'), props.theme.getColor('orange-500')));
|
|
27
|
+
var placeholderBaseStyle = styled.css(_templateObject4 || (_templateObject4 = defaultTheme._taggedTemplateLiteral(["\n ", "\n\n ", "\n"])), function (props) {
|
|
28
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'));
|
|
33
29
|
}, function (props) {
|
|
34
30
|
return props.theme.themeProp('opacity', 0.6, 0.5);
|
|
35
31
|
});
|
|
36
|
-
var TextAreaContainter = styled__default[
|
|
37
|
-
var Label = styled__default[
|
|
32
|
+
var TextAreaContainter = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject5 || (_templateObject5 = defaultTheme._taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
33
|
+
var Label = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(_templateObject6 || (_templateObject6 = defaultTheme._taggedTemplateLiteral(["\n ", ";\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n height: 19px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-top: 13px;\n ", "\n"])), function (props) {
|
|
38
34
|
return props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'));
|
|
39
35
|
}, function (props) {
|
|
40
|
-
return props.disabled && styled.css(
|
|
36
|
+
return props.disabled && styled.css(_templateObject7 || (_templateObject7 = defaultTheme._taggedTemplateLiteral(["\n cursor: not-allowed;\n "])));
|
|
41
37
|
});
|
|
42
|
-
var InputIconContainer = styled__default[
|
|
38
|
+
var InputIconContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject8 || (_templateObject8 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0;\n pointer-events: none;\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n display: flex;\n align-items: flex-start;\n\n position: absolute;\n right: 15px;\n top: 10px;\n bottom: 0;\n > .smallPadingIcon {\n padding: 4px;\n width: 15px;\n height: 15px;\n border-radius: 5px;\n opacity: 1;\n margin-top: -5px;\n ", "\n }\n svg {\n width: 15px;\n opacity: 0.7;\n transition: opacity 250ms;\n\n ", "\n }\n"])), function (props) {
|
|
43
39
|
return props.theme.themeProp('background-color', props.theme.getColor('gray-900'), props.theme.getColor('gray-300'), '!important');
|
|
44
40
|
}, function (props) {
|
|
45
|
-
return props.disabled && styled.css(
|
|
41
|
+
return props.disabled && styled.css(_templateObject9 || (_templateObject9 = defaultTheme._taggedTemplateLiteral(["\n display: none;\n "])));
|
|
46
42
|
});
|
|
47
|
-
var TextInputField = styled__default[
|
|
48
|
-
return props.borderRadius && styled.css(
|
|
43
|
+
var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.applyDefaultTheme)(_templateObject10 || (_templateObject10 = 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) {
|
|
44
|
+
return props.borderRadius && styled.css(_templateObject11 || (_templateObject11 = defaultTheme._taggedTemplateLiteral(["\n border-radius: ", "px;\n "])), props.borderRadius);
|
|
49
45
|
}, function (props) {
|
|
50
46
|
return props.theme.themeProp('color', 'white', 'black');
|
|
51
47
|
}, function (props) {
|
|
52
|
-
return props.readOnly && styled.css(
|
|
48
|
+
return props.readOnly && styled.css(_templateObject12 || (_templateObject12 = defaultTheme._taggedTemplateLiteral(["\n cursor: default;\n border-color: transparent !important;\n "])));
|
|
53
49
|
}, function (props) {
|
|
54
|
-
return props.disabled && styled.css(
|
|
50
|
+
return props.disabled && styled.css(_templateObject13 || (_templateObject13 = defaultTheme._taggedTemplateLiteral(["\n cursor: not-allowed;\n "])));
|
|
51
|
+
}, function (props) {
|
|
52
|
+
return props.readOnly && styled.css(_templateObject14 || (_templateObject14 = defaultTheme._taggedTemplateLiteral(["\n padding: 12px 10px; ;\n "])));
|
|
55
53
|
}, function (props) {
|
|
56
54
|
return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'));
|
|
55
|
+
}, function (props) {
|
|
56
|
+
return (props.state === 'warning' || props.state === 'error') && props.theme.themeProp('color', props.theme.getColor('gray-900'), props.theme.getColor('gray-900'));
|
|
57
57
|
}, function (props) {
|
|
58
58
|
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
59
59
|
}, function (props) {
|
|
60
60
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400'));
|
|
61
61
|
}, function (props) {
|
|
62
|
-
return props.noBorder && styled.css(
|
|
62
|
+
return props.noBorder && styled.css(_templateObject15 || (_templateObject15 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
63
63
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
64
64
|
});
|
|
65
65
|
}, function (props) {
|
|
66
|
-
return props.type === 'warning' && styled.css(
|
|
66
|
+
return props.type === 'warning' && styled.css(_templateObject16 || (_templateObject16 = 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'));
|
|
67
67
|
}, function (props) {
|
|
68
|
-
return props.type === 'error' && styled.css(
|
|
68
|
+
return props.type === 'error' && styled.css(_templateObject17 || (_templateObject17 = 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'));
|
|
69
69
|
}, function (props) {
|
|
70
|
-
return props.noBorder && props.type === 'warning' && styled.css(
|
|
71
|
-
return props.theme.themeProp('border-color', '#
|
|
70
|
+
return props.noBorder && props.type === 'warning' && styled.css(_templateObject18 || (_templateObject18 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
71
|
+
return props.theme.themeProp('border-color', '#2F2402', '#F2D16B');
|
|
72
72
|
});
|
|
73
73
|
}, function (props) {
|
|
74
|
-
return props.noBorder && props.type === 'error' && styled.css(
|
|
74
|
+
return props.noBorder && props.type === 'error' && styled.css(_templateObject19 || (_templateObject19 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
75
75
|
return props.theme.themeProp('border-color', '#7f1b1b', '#FBEAE6');
|
|
76
76
|
});
|
|
77
77
|
}, function (props) {
|
|
78
|
-
return props.type === 'warning-border' && styled.css(
|
|
78
|
+
return props.type === 'warning-border' && styled.css(_templateObject20 || (_templateObject20 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('border-color', props.theme.getColor('red-200'), props.theme.getColor('orange-500')));
|
|
79
|
+
}, function (props) {
|
|
80
|
+
return props.type === 'error-border' && styled.css(_templateObject21 || (_templateObject21 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('border-color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
81
|
+
}, function (props) {
|
|
82
|
+
return props.lightBackground && styled.css(_templateObject22 || (_templateObject22 = 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'));
|
|
83
|
+
}, function (props) {
|
|
84
|
+
return props.edit && props.type != 'warning' && props.theme.themeProp('background', '#505050', '#eff1f4');
|
|
79
85
|
}, function (props) {
|
|
80
|
-
return props.type === '
|
|
86
|
+
return props.edit && props.type === 'warning' && props.theme.themeProp('background', '#AD8800', '#FFF3A7');
|
|
81
87
|
}, function (props) {
|
|
82
88
|
return props.padding === 'small' && styled.css(_templateObject23 || (_templateObject23 = defaultTheme._taggedTemplateLiteral(["\n padding: 5px 10px;\n "])));
|
|
83
89
|
}, function (props) {
|
|
@@ -91,17 +97,21 @@ var TextInputField = styled__default["default"].textarea.attrs(defaultTheme.appl
|
|
|
91
97
|
}, function (props) {
|
|
92
98
|
return props.edit && props.theme.themeProp('border-color', props.theme.getColor('gray-700'), props.theme.getColor('gray-100'));
|
|
93
99
|
}, function (props) {
|
|
94
|
-
return props.type === 'warning' && props.theme.themeProp('background', '#806403', '#
|
|
100
|
+
return props.type === 'warning' && props.theme.themeProp('background', '#806403', '#FFDB70');
|
|
95
101
|
}, function (props) {
|
|
96
|
-
return props.type === 'error' && props.theme.themeProp('background', '#
|
|
102
|
+
return props.type === 'error' && props.theme.themeProp('background', '#F7D5D0', '#F7D5D0');
|
|
97
103
|
}, function (props) {
|
|
98
104
|
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';
|
|
99
105
|
}, InputIconContainer, function (props) {
|
|
100
106
|
return props.type === 'success' && styled.css(_templateObject27 || (_templateObject27 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0;\n "])));
|
|
101
|
-
},
|
|
107
|
+
}, function (props) {
|
|
108
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'), 1);
|
|
109
|
+
}, function (props) {
|
|
110
|
+
return props.theme.themeProp('opacity', 0.6, 0.5, 1);
|
|
111
|
+
}, function (props) {
|
|
102
112
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-600'));
|
|
103
113
|
}, function (props) {
|
|
104
|
-
return props.theme.themeProp('background', '
|
|
114
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white'));
|
|
105
115
|
}, function (props) {
|
|
106
116
|
return props.type === 'warning' && styled.css(_templateObject28 || (_templateObject28 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), function (props) {
|
|
107
117
|
return props.theme.themeProp('border-color', '#F4E21E', '#F4E21E');
|
|
@@ -118,8 +128,10 @@ var TextInputField = styled__default["default"].textarea.attrs(defaultTheme.appl
|
|
|
118
128
|
return props.noBorder && props.edit && styled.css(_templateObject30 || (_templateObject30 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
119
129
|
return props.theme.themeProp('border-color', '#27272A', 'rgba(244,244,245, 0.3)');
|
|
120
130
|
});
|
|
131
|
+
}, function (props) {
|
|
132
|
+
return props.edit && props.type === 'warning' && props.theme.themeProp('background', '#2F2402', '#FFF3A7');
|
|
121
133
|
});
|
|
122
|
-
var TextInputLabel = styled__default[
|
|
134
|
+
var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(_templateObject31 || (_templateObject31 = 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) {
|
|
123
135
|
return props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'));
|
|
124
136
|
}, placeholderBaseStyle, function (props) {
|
|
125
137
|
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%)"));
|
|
@@ -130,84 +142,98 @@ var TextInputLabel = styled__default["default"].label.attrs(defaultTheme.applyDe
|
|
|
130
142
|
}, function (props) {
|
|
131
143
|
return props.hasIcon && styled.css(_templateObject34 || (_templateObject34 = defaultTheme._taggedTemplateLiteral(["\n left: 55px;\n "])));
|
|
132
144
|
});
|
|
133
|
-
var TextInputFieldIcon = styled__default[
|
|
134
|
-
var TextInputFieldIconAlert = styled__default[
|
|
145
|
+
var TextInputFieldIcon = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject35 || (_templateObject35 = 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"])));
|
|
146
|
+
var TextInputFieldIconAlert = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject36 || (_templateObject36 = 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) {
|
|
135
147
|
return props.type === 'warning' && props.theme.themeProp('color', '#EAB308', '#2F2402');
|
|
136
148
|
});
|
|
137
|
-
var TextInput = styled__default[
|
|
149
|
+
var TextInput = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject37 || (_templateObject37 = defaultTheme._taggedTemplateLiteral(["\n position: relative;\n flex-basis: ", ";\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) {
|
|
138
150
|
return props.$fieldLabel ? '66.66%' : '100%';
|
|
139
151
|
}, function (props) {
|
|
140
|
-
return props.readOnly && styled.css(_templateObject38 || (_templateObject38 = defaultTheme._taggedTemplateLiteral(["\n
|
|
152
|
+
return props.readOnly && styled.css(_templateObject38 || (_templateObject38 = defaultTheme._taggedTemplateLiteral(["\n pointer-events: none;\n "])));
|
|
141
153
|
}, function (props) {
|
|
142
154
|
return props.disabled && styled.css(_templateObject39 || (_templateObject39 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0.5;\n\n > * {\n cursor: not-allowed;\n }\n "])));
|
|
143
155
|
}, TextInputLabel, activeLabel, TextInputFieldIcon, TextInputField, TextInputLabel, activeLabel, function (props) {
|
|
144
156
|
return props.type === 'error' && props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500'));
|
|
145
157
|
});
|
|
146
|
-
var Description = styled__default[
|
|
158
|
+
var Description = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject40 || (_templateObject40 = 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) {
|
|
147
159
|
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'));
|
|
148
160
|
}, function (props) {
|
|
149
161
|
return (props.type === 'warning-border' || props.type === 'warning') && styled.css(_templateObject41 || (_templateObject41 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('orange-500')));
|
|
150
162
|
}, function (props) {
|
|
151
163
|
return (props.type === 'error-border' || props.type === 'error') && styled.css(_templateObject42 || (_templateObject42 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
152
164
|
});
|
|
153
|
-
var SuccessContainer = styled__default[
|
|
165
|
+
var SuccessContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject43 || (_templateObject43 = 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) {
|
|
154
166
|
return props.fadeIn ? 0 : 1;
|
|
155
167
|
}, function (props) {
|
|
156
168
|
return props.fadeIn ? fadeOutCheck : fadeInCheck;
|
|
157
169
|
}, function (props) {
|
|
158
170
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'));
|
|
159
171
|
});
|
|
160
|
-
var SuccessContainerLabel = styled__default[
|
|
172
|
+
var SuccessContainerLabel = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject44 || (_templateObject44 = 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 margin-right: 5px;\n margin-top: -7px;\n width: 15px;\n height: 15px;\n padding: 5px;\n ", "\n\n > svg {\n width: 13px;\n }\n"])), function (props) {
|
|
161
173
|
return props.fadeIn ? 0 : 1;
|
|
162
174
|
}, function (props) {
|
|
163
175
|
return props.fadeIn ? fadeOutCheck : fadeInCheck;
|
|
164
176
|
}, function (props) {
|
|
165
177
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'));
|
|
166
178
|
});
|
|
179
|
+
styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject45 || (_templateObject45 = 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) {
|
|
180
|
+
return props.expanded && styled.css(_templateObject46 || (_templateObject46 = defaultTheme._taggedTemplateLiteral(["\n margin-top: 0px;\n "])));
|
|
181
|
+
}, function (props) {
|
|
182
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
183
|
+
}, function (props) {
|
|
184
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('emerald-500'));
|
|
185
|
+
}, function (props) {
|
|
186
|
+
return props.type === 'error' && styled.css(_templateObject47 || (_templateObject47 = defaultTheme._taggedTemplateLiteral(["\n content: 'error';\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
187
|
+
});
|
|
167
188
|
|
|
168
|
-
var
|
|
169
|
-
var TextArea = React__default["default"].forwardRef(function TextArea(_ref, forwardedRef) {
|
|
189
|
+
var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forwardedRef) {
|
|
170
190
|
var value = _ref.value,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
191
|
+
defaultValue = _ref.defaultValue,
|
|
192
|
+
name = _ref.name,
|
|
193
|
+
label = _ref.label,
|
|
194
|
+
placeholder = _ref.placeholder,
|
|
195
|
+
required = _ref.required,
|
|
196
|
+
disabled = _ref.disabled,
|
|
197
|
+
hidden = _ref.hidden,
|
|
198
|
+
readOnly = _ref.readOnly,
|
|
199
|
+
edit = _ref.edit,
|
|
200
|
+
autoComplete = _ref.autoComplete,
|
|
201
|
+
description = _ref.description,
|
|
202
|
+
type = _ref.type,
|
|
203
|
+
icon = _ref.icon,
|
|
204
|
+
rows = _ref.rows,
|
|
205
|
+
className = _ref.className,
|
|
206
|
+
style = _ref.style,
|
|
207
|
+
_onChange = _ref.onChange,
|
|
208
|
+
onBlur = _ref.onBlur,
|
|
209
|
+
lightBackground = _ref.lightBackground,
|
|
210
|
+
noBorder = _ref.noBorder,
|
|
211
|
+
instructionsTextArea = _ref.instructionsTextArea,
|
|
212
|
+
loadingIcon = _ref.loadingIcon,
|
|
213
|
+
successIcon = _ref.successIcon,
|
|
214
|
+
padding = _ref.padding,
|
|
215
|
+
descriptionToolTip = _ref.descriptionToolTip,
|
|
216
|
+
borderRadius = _ref.borderRadius,
|
|
217
|
+
fieldLabel = _ref.fieldLabel,
|
|
218
|
+
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", "fieldLabel"]);
|
|
219
|
+
|
|
198
220
|
var textInputDomNode = React.useRef(null);
|
|
199
221
|
var textInputRef = useMergedRefs.useMergedRefs(forwardedRef, textInputDomNode);
|
|
222
|
+
|
|
200
223
|
var _useState = React.useState(!(value || defaultValue)),
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
224
|
+
_useState2 = defaultTheme._slicedToArray(_useState, 2),
|
|
225
|
+
inputIsEmpty = _useState2[0],
|
|
226
|
+
setInputIsEmpty = _useState2[1];
|
|
227
|
+
|
|
204
228
|
var _useState3 = React.useState(false),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
229
|
+
_useState4 = defaultTheme._slicedToArray(_useState3, 2),
|
|
230
|
+
autoFocus = _useState4[0],
|
|
231
|
+
setAutoFocus = _useState4[1];
|
|
232
|
+
|
|
208
233
|
var _useState5 = React.useState(nanoid.nanoid()),
|
|
209
|
-
|
|
210
|
-
|
|
234
|
+
_useState6 = defaultTheme._slicedToArray(_useState5, 1),
|
|
235
|
+
uniqueId = _useState6[0];
|
|
236
|
+
|
|
211
237
|
var memoizedDescriptionToolTip = React.useMemo(function () {
|
|
212
238
|
return descriptionToolTip;
|
|
213
239
|
}, [descriptionToolTip]);
|
|
@@ -219,20 +245,21 @@ var TextArea = React__default["default"].forwardRef(function TextArea(_ref, forw
|
|
|
219
245
|
event.stopPropagation();
|
|
220
246
|
}
|
|
221
247
|
}, []);
|
|
248
|
+
|
|
222
249
|
var input = function input() {
|
|
223
|
-
return React__default[
|
|
250
|
+
return React__default['default'].createElement(TextAreaContainter, null, fieldLabel && React__default['default'].createElement(Label, {
|
|
224
251
|
htmlFor: uniqueId,
|
|
225
252
|
disabled: disabled
|
|
226
|
-
}, fieldLabel, React__default[
|
|
253
|
+
}, fieldLabel, React__default['default'].createElement(SuccessContainerLabel, null, type === 'loading' && loadingIcon, type === 'success' && successIcon)), React__default['default'].createElement(TextInput, {
|
|
227
254
|
$fieldLabel: !lodash.isEmpty(fieldLabel),
|
|
228
255
|
disabled: disabled,
|
|
229
256
|
readOnly: readOnly,
|
|
230
257
|
type: type,
|
|
231
258
|
className: className,
|
|
232
259
|
style: style
|
|
233
|
-
}, React__default[
|
|
260
|
+
}, React__default['default'].createElement(TextInputFieldIconAlert, {
|
|
234
261
|
type: type
|
|
235
|
-
}, icon), React__default[
|
|
262
|
+
}, icon), React__default['default'].createElement(TextInputField, defaultTheme._extends({
|
|
236
263
|
autoFocus: autoFocus,
|
|
237
264
|
borderRadius: borderRadius,
|
|
238
265
|
ref: textInputRef,
|
|
@@ -252,40 +279,44 @@ var TextArea = React__default["default"].forwardRef(function TextArea(_ref, forw
|
|
|
252
279
|
icon: icon,
|
|
253
280
|
id: "text-input-".concat(uniqueId),
|
|
254
281
|
key: uniqueId,
|
|
282
|
+
lightBackground: lightBackground,
|
|
255
283
|
padding: padding,
|
|
256
284
|
onChange: function onChange(e) {
|
|
257
285
|
if (e.target.value) {
|
|
258
286
|
setInputIsEmpty(false);
|
|
287
|
+
|
|
259
288
|
if (!autoFocus) {
|
|
260
289
|
setAutoFocus(true);
|
|
261
290
|
}
|
|
262
291
|
} else {
|
|
263
292
|
setInputIsEmpty(true);
|
|
293
|
+
|
|
264
294
|
if (!autoFocus) {
|
|
265
295
|
setAutoFocus(true);
|
|
266
296
|
}
|
|
267
297
|
}
|
|
298
|
+
|
|
268
299
|
_onChange(e);
|
|
269
300
|
},
|
|
270
301
|
onKeyDown: onKeyDown,
|
|
271
302
|
onBlur: onBlur,
|
|
272
303
|
noBorder: noBorder
|
|
273
|
-
}, rest)), !fieldLabel && (type === 'loading' || type === 'success') && React__default[
|
|
304
|
+
}, rest)), !fieldLabel && (type === 'loading' || type === 'success') && React__default['default'].createElement(SuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon), !readOnly && noBorder && React__default['default'].createElement(InputIconContainer, {
|
|
274
305
|
disabled: disabled
|
|
275
|
-
}, React__default[
|
|
306
|
+
}, React__default['default'].createElement(editNote.SvgEditNote, {
|
|
276
307
|
className: padding === 'small' ? 'smallPadingIcon' : undefined
|
|
277
|
-
})), label && React__default[
|
|
308
|
+
})), label && React__default['default'].createElement(TextInputLabel, {
|
|
278
309
|
htmlFor: "text-input-".concat(uniqueId),
|
|
279
310
|
hasPlaceholder: Boolean(placeholder),
|
|
280
311
|
hasIcon: Boolean(icon),
|
|
281
|
-
inputIsEmpty: inputIsEmpty
|
|
282
|
-
|
|
283
|
-
}, label, required && ' *'), typeof description === 'string' && description.length > 0 && React__default["default"].createElement(Description, {
|
|
312
|
+
inputIsEmpty: inputIsEmpty
|
|
313
|
+
}, label, required && ' *'), typeof description === 'string' && description.length > 0 && React__default['default'].createElement(Description, {
|
|
284
314
|
type: type
|
|
285
315
|
}, description)));
|
|
286
316
|
};
|
|
317
|
+
|
|
287
318
|
if (hidden) return null;
|
|
288
|
-
return React__default[
|
|
319
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null, !memoizedDescriptionToolTip && input(), memoizedDescriptionToolTip && React__default['default'].createElement("div", null, React__default['default'].createElement(Tooltip.Tooltip, {
|
|
289
320
|
content: memoizedDescriptionToolTip,
|
|
290
321
|
key: "tooltipTextArea1",
|
|
291
322
|
placement: "bottom-end",
|
|
@@ -328,6 +359,7 @@ TextArea.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
328
359
|
className: defaultTheme.PropTypes.string,
|
|
329
360
|
style: defaultTheme.PropTypes.object,
|
|
330
361
|
padding: defaultTheme.PropTypes.oneOf(['small', 'medium', 'large']),
|
|
362
|
+
lightBackground: defaultTheme.PropTypes.bool,
|
|
331
363
|
onChange: defaultTheme.PropTypes.func,
|
|
332
364
|
onBlur: defaultTheme.PropTypes.func,
|
|
333
365
|
noBorder: defaultTheme.PropTypes.bool,
|