@ntbjs/react-components 1.3.0-rc.4 → 1.3.0-rc.40
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 +7 -8
- package/{ActionButton-46735b89.js → ActionButton-df714c16.js} +23 -18
- package/{Alert-13b75102.js → Alert-28de48e1.js} +30 -29
- package/{AssetGallery-7d05ac94.js → AssetAction-b7926b8e.js} +790 -655
- package/AssetPreviewTopBar-5636a6e9.js +118 -0
- package/{Badge-757b0a39.js → Badge-2e008fe7.js} +44 -54
- package/Button-0a19dec5.js +284 -0
- package/Checkbox-89fb44b0.js +152 -0
- package/CompactAutocompleteSelect-8edde787.js +478 -0
- package/CompactStarRating-c02080fd.js +343 -0
- package/CompactTextInput-1a216516.js +380 -0
- package/{ContextMenu-4ec3d9f3.js → ContextMenu-265b13dc.js} +9 -7
- package/ContextMenuItem-9008feb7.js +114 -0
- package/{InputGroup-49fbc423.js → InputGroup-daac9ea0.js} +9 -7
- package/{Instructions-e5947be9.js → Instructions-2a452d51.js} +109 -82
- package/{MultiLevelCheckboxSelect-b897d605.js → MultiLevelCheckboxSelect-d8e6ab4c.js} +158 -168
- package/MultiSelect-36f99f25.js +406 -0
- package/{Popover-569cd272.js → Popover-8e025dcb.js} +24 -24
- package/Radio-ecf4226c.js +90 -0
- package/{SectionSeparator-259a22ed.js → SectionSeparator-e69cddfd.js} +9 -7
- package/Switch-76d7d568.js +122 -0
- package/{Tab-f499ecbc.js → Tab-74c2bca2.js} +10 -8
- package/{Tabs-a8c77f71.js → Tabs-41bd6cc1.js} +54 -44
- package/TextArea-40baf21d.js +382 -0
- package/TextInput-c1bb5c8c.js +252 -0
- package/{Tooltip-66daf6e3.js → Tooltip-dbd1bc99.js} +16 -14
- package/{VerificationStatusIcon-d5bfb67a.js → VerificationStatusIcon-b43db48d.js} +30 -32
- package/{close-ebf2f3cf.js → close-1751121a.js} +8 -12
- 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-ea44e34a.js → defaultTheme-b6420d7d.js} +206 -263
- package/edit-note-cefe2215.js +37 -0
- package/{expand-more-94585605.js → expand-more-d74e2bd2.js} +8 -12
- 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 +12 -12
- 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 +6 -5
- package/{react-select-creatable.esm-2f23d6c6.js → react-select-creatable.esm-ca527471.js} +1503 -1282
- package/{shift-away-subtle-0bed9a3c.js → shift-away-subtle-e3830923.js} +1 -1
- package/ssr/index.js +1 -3
- package/widgets/AssetGallery/index.js +34 -32
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +3 -3
- package/widgets/ContextMenu/ContextMenuItem/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +9 -7
- package/widgets/ContextMenu/index.js +2 -2
- package/widgets/Instructions/index.js +16 -17
- package/widgets/index.js +37 -35
- package/AssetPreviewTopBar-912c3469.js +0 -99
- package/Button-49f82b31.js +0 -264
- package/Checkbox-68dc38a8.js +0 -140
- package/CompactAutocompleteSelect-755b1869.js +0 -451
- package/CompactStarRating-bcfb78ac.js +0 -339
- package/CompactTextInput-9e507306.js +0 -349
- package/ContextMenuItem-ba2b697e.js +0 -110
- package/MultiSelect-efd60232.js +0 -377
- package/Radio-32d0513a.js +0 -86
- package/Switch-4a41585f.js +0 -107
- package/TextArea-8f62da6e.js +0 -353
- package/TextInput-0d109708.js +0 -236
- package/edit-note-c47d292e.js +0 -41
- package/warning-circle-24522402.js +0 -41
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultTheme = require('./defaultTheme-b6420d7d.js');
|
|
4
|
+
var lodash = require('lodash');
|
|
5
|
+
var nanoid = require('nanoid');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var editNote = require('./edit-note-cefe2215.js');
|
|
8
|
+
require('./Alert-28de48e1.js');
|
|
9
|
+
require('./Badge-2e008fe7.js');
|
|
10
|
+
var Popover = require('./Popover-8e025dcb.js');
|
|
11
|
+
require('./Tab-74c2bca2.js');
|
|
12
|
+
require('./Tabs-41bd6cc1.js');
|
|
13
|
+
var Tooltip = require('./Tooltip-dbd1bc99.js');
|
|
14
|
+
require('./VerificationStatusIcon-b43db48d.js');
|
|
15
|
+
var styled = require('styled-components');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
function _interopNamespace(e) {
|
|
20
|
+
if (e && e.__esModule) return e;
|
|
21
|
+
var n = Object.create(null);
|
|
22
|
+
if (e) {
|
|
23
|
+
Object.keys(e).forEach(function (k) {
|
|
24
|
+
if (k !== 'default') {
|
|
25
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
26
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return e[k]; }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
n["default"] = e;
|
|
34
|
+
return Object.freeze(n);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
38
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
39
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
40
|
+
|
|
41
|
+
var _path;
|
|
42
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
43
|
+
function SvgLink(props) {
|
|
44
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
viewBox: "0 0 20 10"
|
|
47
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
48
|
+
fill: "currentColor",
|
|
49
|
+
d: "M9 10H5c-1.38 0-2.56-.49-3.54-1.46S0 6.39 0 5s.49-2.56 1.46-3.54S3.62 0 5 0h4v2H5c-.83 0-1.54.29-2.13.88s-.88 1.29-.88 2.13.29 1.54.88 2.13 1.29.88 2.13.88h4v2zM6 6V4h8v2H6zm5 4V8h4c.83 0 1.54-.29 2.13-.88s.88-1.29.88-2.13-.29-1.54-.88-2.13-1.29-.88-2.13-.88h-4V0h4c1.38 0 2.56.49 3.54 1.46S20 3.61 20 5s-.49 2.56-1.46 3.54S16.39 10 15 10h-4z"
|
|
50
|
+
})));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var fadeIn = styled.keyframes(["from{background-color:", ";}to{background-color:", ";}"], function (props) {
|
|
54
|
+
return props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)');
|
|
55
|
+
}, function (props) {
|
|
56
|
+
return props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)');
|
|
57
|
+
});
|
|
58
|
+
var fadeOut = styled.keyframes(["from{background-color:", ";}to{background-color:", ";}"], function (props) {
|
|
59
|
+
return props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)');
|
|
60
|
+
}, function (props) {
|
|
61
|
+
return props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)');
|
|
62
|
+
});
|
|
63
|
+
var fadeInCheck = styled.keyframes(["from{opacity:0}to{opacity:1}"]);
|
|
64
|
+
var fadeOutCheck = styled.keyframes(["from{opacity:1}to{opacity:0}"]);
|
|
65
|
+
var linkColor = styled.css(["", ""], function (props) {
|
|
66
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('emerald-500'));
|
|
67
|
+
});
|
|
68
|
+
var commonAnchorTagStyle = styled.css(["a,&&{font-size:0.875rem;text-decoration:underline;}"]);
|
|
69
|
+
var readOnlyBackground = styled.css(["", ""], function (props) {
|
|
70
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
71
|
+
});
|
|
72
|
+
var CompactTextInput$1 = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
73
|
+
displayName: "CompactTextInputstyled__CompactTextInput",
|
|
74
|
+
componentId: "sc-1r3fuy6-0"
|
|
75
|
+
})(["display:flex;align-items:center;height:24px;font-family:", ";"], function (props) {
|
|
76
|
+
return props.theme.primaryFontFamily;
|
|
77
|
+
});
|
|
78
|
+
var Label = styled__default["default"].label.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
79
|
+
displayName: "CompactTextInputstyled__Label",
|
|
80
|
+
componentId: "sc-1r3fuy6-1"
|
|
81
|
+
})(["", ";flex-basis:33.33%;font-size:0.875rem;line-height:1rem;justify-content:space-between;height:19px;display:flex;align-items:center;", ""], function (props) {
|
|
82
|
+
return props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'));
|
|
83
|
+
}, function (props) {
|
|
84
|
+
return props.disabled && styled.css(["opacity:0.5;cursor:not-allowed;"]);
|
|
85
|
+
});
|
|
86
|
+
var InputContainer = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
87
|
+
displayName: "CompactTextInputstyled__InputContainer",
|
|
88
|
+
componentId: "sc-1r3fuy6-2"
|
|
89
|
+
})(["position:relative;height:19px;flex-basis:", ";"], function (props) {
|
|
90
|
+
return props.$hasLabel ? '66.66%' : '100%';
|
|
91
|
+
});
|
|
92
|
+
var SuccessContainer = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
93
|
+
displayName: "CompactTextInputstyled__SuccessContainer",
|
|
94
|
+
componentId: "sc-1r3fuy6-3"
|
|
95
|
+
})(["opacity:1;pointer-events:none;display:flex;opacity:", ";animation:", " 0.5s ease-in-out;transition:opacity 0.5s ease-in-out;margin-right:5px;", " > svg{width:13px;}"], function (props) {
|
|
96
|
+
return props.fadeIn ? 0 : 1;
|
|
97
|
+
}, function (props) {
|
|
98
|
+
return props.fadeIn ? fadeOutCheck : fadeInCheck;
|
|
99
|
+
}, function (props) {
|
|
100
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'));
|
|
101
|
+
});
|
|
102
|
+
var InputSuccessContainer = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
103
|
+
displayName: "CompactTextInputstyled__InputSuccessContainer",
|
|
104
|
+
componentId: "sc-1r3fuy6-4"
|
|
105
|
+
})(["opacity:1;pointer-events:none;display:flex;justify-content:flex-end;opacity:", ";animation:", " 0.5s ease-in-out;transition:opacity 0.5s ease-in-out;position:relative;margin-top:-20px;margin-right:8px;", " > svg{width:13px;}"], function (props) {
|
|
106
|
+
return props.fadeIn ? 0 : 1;
|
|
107
|
+
}, function (props) {
|
|
108
|
+
return props.fadeIn ? fadeOutCheck : fadeInCheck;
|
|
109
|
+
}, function (props) {
|
|
110
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'));
|
|
111
|
+
});
|
|
112
|
+
var InputIconContainer = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
113
|
+
displayName: "CompactTextInputstyled__InputIconContainer",
|
|
114
|
+
componentId: "sc-1r3fuy6-5"
|
|
115
|
+
})(["opacity:0;pointer-events:none;border-top-right-radius:3px;border-bottom-right-radius:3px;padding:5px 10px 0 0;", ";display:flex;align-items:center;position:absolute;right:0;top:0;bottom:0;color:", ";", " ", " > svg{width:12px;}"], function (props) {
|
|
116
|
+
return props.theme.themeProp('background', styled.css(["linear-gradient(-90deg,", " 55%,transparent)"], function (props) {
|
|
117
|
+
return props.type === 'error' ? '#901d1d' : props.type === 'warning' ? '#816600' : props.theme.getColor('gray-700');
|
|
118
|
+
}), styled.css(["linear-gradient(-90deg,", " 55%,transparent)"], function (props) {
|
|
119
|
+
return props.type === 'error' ? '#f7d5d0' : props.type === 'warning' ? '#fffebf' : props.theme.getColor('gray-100');
|
|
120
|
+
}));
|
|
121
|
+
}, function (props) {
|
|
122
|
+
return props.theme.getColor('gray-400');
|
|
123
|
+
}, function (props) {
|
|
124
|
+
return props.type === 'warning' && props.theme.themeProp('color', '#C3AF43', '#C3AF43');
|
|
125
|
+
}, function (props) {
|
|
126
|
+
return props.type === 'error' && props.theme.themeProp('color', '#CB968F', '#CB968F');
|
|
127
|
+
});
|
|
128
|
+
var Input = styled__default["default"].input.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
129
|
+
displayName: "CompactTextInputstyled__Input",
|
|
130
|
+
componentId: "sc-1r3fuy6-6"
|
|
131
|
+
})(["box-sizing:border-box;height:22px;width:100%;display:block;font-size:0.875rem;line-height:1rem;font-family:inherit;padding:1px 10px;border-radius:3px;border:1px solid transparent;", " ", " ", " ", " ", ";", ";", ";", ";&&:not(:hover):not(:focus){", ";", ";", "}&&:hover:not(:focus){", " ", ";", ";", ";", ";", " & + ", "{opacity:1;}}", " ", "}&&:focus{", ";", ";", ";", ";outline:none;", ";", ";}&&::placeholder{color:inherit;opacity:0.6;}", ""], function (props) {
|
|
132
|
+
return props.readOnly && styled.css(["cursor:default;"]);
|
|
133
|
+
}, function (props) {
|
|
134
|
+
return props.disabled && styled.css(["opacity:0.5;"]);
|
|
135
|
+
}, function (props) {
|
|
136
|
+
return props.type === 'success' && styled.css(["animation:", " 0.5s ease-in-out;"], function (props) {
|
|
137
|
+
return props.type === 'success' ? fadeIn : fadeOut;
|
|
138
|
+
});
|
|
139
|
+
}, function (props) {
|
|
140
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700'));
|
|
141
|
+
}, function (props) {
|
|
142
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
143
|
+
}, function (props) {
|
|
144
|
+
return props.type === 'warning' && props.theme.themeProp('background', '#634E01', '#FFFDE8');
|
|
145
|
+
}, function (props) {
|
|
146
|
+
return props.type === 'error' && props.theme.themeProp('background', '#7f1b1b', '#FBEAE6');
|
|
147
|
+
}, function (props) {
|
|
148
|
+
return props.hasLink && styled.css(["&&:not(:focus),&&:read-only{text-decoration:underline;", "}&&:read-only{cursor:default;}"], linkColor);
|
|
149
|
+
}, function (props) {
|
|
150
|
+
return props.edit && props.theme.themeProp('background', 'rgba(39,39,42, 0.7)', 'rgba(244,244,245, 0.3)');
|
|
151
|
+
}, function (props) {
|
|
152
|
+
return props.edit && props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)');
|
|
153
|
+
}, function (props) {
|
|
154
|
+
return props.hasLink && styled.css(["&&:not(:focus),&&:read-only{text-decoration:underline;cursor:default;", "}"], linkColor);
|
|
155
|
+
}, function (props) {
|
|
156
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100'));
|
|
157
|
+
}, function (props) {
|
|
158
|
+
return props.readOnly && styled.css(["", ""], readOnlyBackground);
|
|
159
|
+
}, function (props) {
|
|
160
|
+
return props.edit && props.theme.themeProp('border-color', props.theme.getColor('gray-700'), props.theme.getColor('gray-100'));
|
|
161
|
+
}, function (props) {
|
|
162
|
+
return props.type === 'warning' && props.theme.themeProp('background', '#806403', '#FFFEBF');
|
|
163
|
+
}, function (props) {
|
|
164
|
+
return props.type === 'error' && props.theme.themeProp('background', '#901d1d', '#F7D5D0');
|
|
165
|
+
}, function (props) {
|
|
166
|
+
return props.hasLink && styled.css(["cursor:pointer;&&:read-only{background:none !important;cursor:default;}"]);
|
|
167
|
+
}, InputIconContainer, function (props) {
|
|
168
|
+
return props.disabled && styled.css(["background:none !important;cursor:not-allowed;"]);
|
|
169
|
+
}, function (props) {
|
|
170
|
+
return props.disabled && props.hasLink && styled.css(["background:none !important;cursor:not-allowed !important;"]);
|
|
171
|
+
}, function (props) {
|
|
172
|
+
return !props.readOnly && props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100'));
|
|
173
|
+
}, function (props) {
|
|
174
|
+
return props.readOnly && styled.css(["", ""], readOnlyBackground);
|
|
175
|
+
}, function (props) {
|
|
176
|
+
return props.type === 'error' && !props.readOnly && props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700'));
|
|
177
|
+
}, function (props) {
|
|
178
|
+
return !props.readOnly && styled.css(["border-color:", ";"], function (props) {
|
|
179
|
+
return props.theme.getColor('gray-600');
|
|
180
|
+
});
|
|
181
|
+
}, function (props) {
|
|
182
|
+
return props.type === 'warning' && styled.css(["", " ", " ", ""], function (props) {
|
|
183
|
+
return props.theme.themeProp('border-color', '#F4E21E', '#F4E21E');
|
|
184
|
+
}, props.theme.themeProp('background', 'white', 'white'), props.theme.themeProp('color', 'black', 'black'));
|
|
185
|
+
}, function (props) {
|
|
186
|
+
return props.type === 'error' && styled.css(["", " ", " ", ""], function (props) {
|
|
187
|
+
return props.theme.themeProp('border-color', '#D83018', '#D83018');
|
|
188
|
+
}, props.theme.themeProp('background', 'white', 'white'), props.theme.themeProp('color', 'black', 'black'));
|
|
189
|
+
}, function (props) {
|
|
190
|
+
return props.bold && styled.css(["font-size:1rem;font-weight:500;line-height:1.0625;padding-top:3px;padding-bottom:2px;"]);
|
|
191
|
+
});
|
|
192
|
+
var LinkPopoverContainer = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
193
|
+
displayName: "CompactTextInputstyled__LinkPopoverContainer",
|
|
194
|
+
componentId: "sc-1r3fuy6-7"
|
|
195
|
+
})(["", " padding:5px 8px;svg{width:18px;margin-right:8px;}"], commonAnchorTagStyle);
|
|
196
|
+
var StyledLink = styled__default["default"].a.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
197
|
+
displayName: "CompactTextInputstyled__StyledLink",
|
|
198
|
+
componentId: "sc-1r3fuy6-8"
|
|
199
|
+
})(["", " ", ""], commonAnchorTagStyle, linkColor);
|
|
200
|
+
var ReadOnlyLinkContainer = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
201
|
+
displayName: "CompactTextInputstyled__ReadOnlyLinkContainer",
|
|
202
|
+
componentId: "sc-1r3fuy6-9"
|
|
203
|
+
})(["", ";border:1px solid transparent;border-radius:3px;padding:0 10px 1px;"], readOnlyBackground);
|
|
204
|
+
|
|
205
|
+
var _excluded = ["label", "inputType", "name", "defaultValue", "value", "placeholder", "link", "linkTarget", "linkHandler", "activeLinkHandler", "autoSelect", "readOnly", "disabled", "edit", "type", "descriptionToolTip", "bold", "hidden", "onChange", "onFocus", "onBlur", "loadingIcon", "successIcon"];
|
|
206
|
+
var CompactTextInput = React__default["default"].forwardRef(function CompactTextInput(_ref, forwardedRef) {
|
|
207
|
+
var label = _ref.label,
|
|
208
|
+
inputType = _ref.inputType,
|
|
209
|
+
name = _ref.name,
|
|
210
|
+
defaultValue = _ref.defaultValue,
|
|
211
|
+
value = _ref.value,
|
|
212
|
+
placeholder = _ref.placeholder,
|
|
213
|
+
link = _ref.link,
|
|
214
|
+
linkTarget = _ref.linkTarget,
|
|
215
|
+
linkHandler = _ref.linkHandler,
|
|
216
|
+
activeLinkHandler = _ref.activeLinkHandler,
|
|
217
|
+
autoSelect = _ref.autoSelect,
|
|
218
|
+
readOnly = _ref.readOnly,
|
|
219
|
+
disabled = _ref.disabled,
|
|
220
|
+
edit = _ref.edit,
|
|
221
|
+
type = _ref.type,
|
|
222
|
+
descriptionToolTip = _ref.descriptionToolTip,
|
|
223
|
+
bold = _ref.bold,
|
|
224
|
+
hidden = _ref.hidden,
|
|
225
|
+
onChangeProp = _ref.onChange,
|
|
226
|
+
onFocusProp = _ref.onFocus,
|
|
227
|
+
onBlurProp = _ref.onBlur,
|
|
228
|
+
loadingIcon = _ref.loadingIcon,
|
|
229
|
+
successIcon = _ref.successIcon,
|
|
230
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
231
|
+
var _useState = React.useState(nanoid.nanoid()),
|
|
232
|
+
_useState2 = defaultTheme._slicedToArray(_useState, 1),
|
|
233
|
+
uniqueId = _useState2[0];
|
|
234
|
+
var _useState3 = React.useState(),
|
|
235
|
+
_useState4 = defaultTheme._slicedToArray(_useState3, 2),
|
|
236
|
+
currentValue = _useState4[0],
|
|
237
|
+
setCurrentValue = _useState4[1];
|
|
238
|
+
var _useState5 = React.useState(false),
|
|
239
|
+
_useState6 = defaultTheme._slicedToArray(_useState5, 2),
|
|
240
|
+
autoFocus = _useState6[0],
|
|
241
|
+
setAutoFocus = _useState6[1];
|
|
242
|
+
var memoizedDescriptionToolTip = React.useMemo(function () {
|
|
243
|
+
return descriptionToolTip;
|
|
244
|
+
}, [descriptionToolTip]);
|
|
245
|
+
React.useEffect(function () {
|
|
246
|
+
setCurrentValue(value || defaultValue);
|
|
247
|
+
setAutoFocus(false);
|
|
248
|
+
}, [value, defaultValue]);
|
|
249
|
+
var onChange = React.useCallback(function (event) {
|
|
250
|
+
setCurrentValue(event.target.value);
|
|
251
|
+
if (!autoFocus) {
|
|
252
|
+
setAutoFocus(true);
|
|
253
|
+
}
|
|
254
|
+
if (lodash.isFunction(onChangeProp)) {
|
|
255
|
+
onChangeProp(event);
|
|
256
|
+
}
|
|
257
|
+
}, [onChangeProp]);
|
|
258
|
+
var onFocus = React.useCallback(function (event) {
|
|
259
|
+
if (autoSelect) {
|
|
260
|
+
event.target.select();
|
|
261
|
+
}
|
|
262
|
+
if (lodash.isFunction(onFocusProp)) {
|
|
263
|
+
onFocusProp(event);
|
|
264
|
+
}
|
|
265
|
+
}, [autoSelect, readOnly, onFocusProp]);
|
|
266
|
+
var onBlur = React.useCallback(function (event) {
|
|
267
|
+
if (lodash.isFunction(onBlurProp)) {
|
|
268
|
+
onBlurProp(event);
|
|
269
|
+
}
|
|
270
|
+
}, [onBlurProp]);
|
|
271
|
+
var input = function input() {
|
|
272
|
+
return React__default["default"].createElement(Input, {
|
|
273
|
+
ref: forwardedRef,
|
|
274
|
+
id: uniqueId,
|
|
275
|
+
key: uniqueId,
|
|
276
|
+
autoFocus: autoFocus,
|
|
277
|
+
inputType: inputType,
|
|
278
|
+
name: name,
|
|
279
|
+
readOnly: readOnly,
|
|
280
|
+
disabled: disabled,
|
|
281
|
+
edit: edit,
|
|
282
|
+
placeholder: placeholder,
|
|
283
|
+
defaultValue: defaultValue,
|
|
284
|
+
value: value,
|
|
285
|
+
type: type,
|
|
286
|
+
bold: bold,
|
|
287
|
+
hasLink: !lodash.isEmpty(link),
|
|
288
|
+
onFocus: onFocus,
|
|
289
|
+
onChange: onChange,
|
|
290
|
+
onBlur: onBlur
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
if (hidden) return null;
|
|
294
|
+
return React__default["default"].createElement(CompactTextInput$1, props, label && React__default["default"].createElement(Label, {
|
|
295
|
+
htmlFor: uniqueId,
|
|
296
|
+
disabled: disabled
|
|
297
|
+
}, label, React__default["default"].createElement(SuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon)), React__default["default"].createElement(InputContainer, {
|
|
298
|
+
$hasLabel: !lodash.isEmpty(label)
|
|
299
|
+
}, !memoizedDescriptionToolTip && !link && input(), memoizedDescriptionToolTip && !link && React__default["default"].createElement("div", null, React__default["default"].createElement(Tooltip.Tooltip, {
|
|
300
|
+
content: memoizedDescriptionToolTip,
|
|
301
|
+
key: "tooltip1",
|
|
302
|
+
placement: "bottom-end",
|
|
303
|
+
trigger: 'mouseenter',
|
|
304
|
+
zIndex: 999999
|
|
305
|
+
}, input())), link && !readOnly && React__default["default"].createElement("div", null, React__default["default"].createElement(Popover.Popover, {
|
|
306
|
+
arrow: false,
|
|
307
|
+
content: React__default["default"].createElement(LinkPopoverContainer, null, activeLinkHandler ? React__default["default"].createElement(StyledLink, {
|
|
308
|
+
href: link,
|
|
309
|
+
target: linkTarget,
|
|
310
|
+
onClick: function onClick(e) {
|
|
311
|
+
if (activeLinkHandler) {
|
|
312
|
+
e.preventDefault();
|
|
313
|
+
linkHandler();
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
rel: "noreferrer"
|
|
317
|
+
}, React__default["default"].createElement(SvgLink, null), currentValue) : React__default["default"].createElement(StyledLink, {
|
|
318
|
+
href: link,
|
|
319
|
+
target: linkTarget,
|
|
320
|
+
rel: "noreferrer"
|
|
321
|
+
}, React__default["default"].createElement(SvgLink, null), currentValue)),
|
|
322
|
+
key: "tooltip2",
|
|
323
|
+
placement: "bottom-start",
|
|
324
|
+
trigger: "focusin",
|
|
325
|
+
zIndex: 999999,
|
|
326
|
+
interactive: true
|
|
327
|
+
}, input())), link && readOnly && React__default["default"].createElement(ReadOnlyLinkContainer, null, React__default["default"].createElement(StyledLink, {
|
|
328
|
+
href: link,
|
|
329
|
+
rel: "noreferrer",
|
|
330
|
+
style: {
|
|
331
|
+
display: 'inline-block'
|
|
332
|
+
},
|
|
333
|
+
target: linkTarget
|
|
334
|
+
}, currentValue)), !readOnly && !disabled && React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(InputIconContainer, {
|
|
335
|
+
type: type
|
|
336
|
+
}, React__default["default"].createElement(editNote.SvgEditNote, null)), lodash.isEmpty(label) && React__default["default"].createElement(InputSuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon))));
|
|
337
|
+
});
|
|
338
|
+
CompactTextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
339
|
+
label: defaultTheme.PropTypes.string,
|
|
340
|
+
success: defaultTheme.PropTypes.bool,
|
|
341
|
+
inputType: defaultTheme.PropTypes.string,
|
|
342
|
+
name: defaultTheme.PropTypes.string,
|
|
343
|
+
defaultValue: defaultTheme.PropTypes.string,
|
|
344
|
+
value: defaultTheme.PropTypes.string,
|
|
345
|
+
placeholder: defaultTheme.PropTypes.string,
|
|
346
|
+
link: defaultTheme.PropTypes.string,
|
|
347
|
+
linkTarget: defaultTheme.PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
348
|
+
linkHandler: defaultTheme.PropTypes.func,
|
|
349
|
+
activeLinkHandler: defaultTheme.PropTypes.bool,
|
|
350
|
+
autoSelect: defaultTheme.PropTypes.bool,
|
|
351
|
+
readOnly: defaultTheme.PropTypes.bool,
|
|
352
|
+
disabled: defaultTheme.PropTypes.bool,
|
|
353
|
+
edit: defaultTheme.PropTypes.bool,
|
|
354
|
+
warning: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.bool, defaultTheme.PropTypes.string]),
|
|
355
|
+
bold: defaultTheme.PropTypes.bool,
|
|
356
|
+
hidden: defaultTheme.PropTypes.bool,
|
|
357
|
+
onChange: defaultTheme.PropTypes.func,
|
|
358
|
+
onFocus: defaultTheme.PropTypes.func,
|
|
359
|
+
onBlur: defaultTheme.PropTypes.func,
|
|
360
|
+
type: defaultTheme.PropTypes.oneOf(['', 'error', 'warning', 'loading', 'success']),
|
|
361
|
+
descriptionToolTip: defaultTheme.PropTypes.string,
|
|
362
|
+
loadingIcon: defaultTheme.PropTypes.element,
|
|
363
|
+
successIcon: defaultTheme.PropTypes.element
|
|
364
|
+
} : {};
|
|
365
|
+
CompactTextInput.defaultProps = {
|
|
366
|
+
inputType: 'text',
|
|
367
|
+
autoSelect: true,
|
|
368
|
+
linkTarget: '_self',
|
|
369
|
+
bold: false,
|
|
370
|
+
readOnly: false,
|
|
371
|
+
descriptionToolTip: '',
|
|
372
|
+
edit: false,
|
|
373
|
+
hidden: false,
|
|
374
|
+
type: '',
|
|
375
|
+
linkHandler: function linkHandler() {},
|
|
376
|
+
activeLinkHandler: false,
|
|
377
|
+
onChange: function onChange() {}
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
exports.CompactTextInput = CompactTextInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-b6420d7d.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
|
|
@@ -9,16 +9,18 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
12
|
+
var ContextMenu$1 = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
13
|
+
displayName: "ContextMenustyled__ContextMenu",
|
|
14
|
+
componentId: "sc-1v876xv-0"
|
|
15
|
+
})(["font-family:", ";padding:3px 0;"], function (props) {
|
|
14
16
|
return props.theme.primaryFontFamily;
|
|
15
17
|
});
|
|
16
18
|
|
|
17
|
-
var
|
|
19
|
+
var _excluded = ["children"];
|
|
20
|
+
var ContextMenu = React__default["default"].forwardRef(function ContextMenu(_ref, forwardedRef) {
|
|
18
21
|
var children = _ref.children,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return React__default['default'].createElement(ContextMenu$1, defaultTheme._extends({
|
|
22
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
return React__default["default"].createElement(ContextMenu$1, defaultTheme._extends({
|
|
22
24
|
ref: forwardedRef
|
|
23
25
|
}, props, {
|
|
24
26
|
role: "menu"
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultTheme = require('./defaultTheme-b6420d7d.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n["default"] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
30
|
+
|
|
31
|
+
var _path;
|
|
32
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
33
|
+
function SvgTriangleRight(props) {
|
|
34
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
35
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
36
|
+
viewBox: "0 0 10 20"
|
|
37
|
+
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
38
|
+
fill: "currentColor",
|
|
39
|
+
d: "M0 20V0l10 10L0 20z"
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var ContextMenuItem$1 = styled__default["default"].span.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
44
|
+
displayName: "ContextMenuItemstyled__ContextMenuItem",
|
|
45
|
+
componentId: "sc-16xi8ez-0"
|
|
46
|
+
})(["align-items:center;cursor:pointer;display:flex;font-family:", ";font-size:0.875rem;font-weight:normal;height:31px;min-width:160px;padding:", ";", " ", " ", " :not(:last-of-type){border-bottom:1px solid;", "}:last-of-type{height:32px;}&:hover{cursor:pointer;", "}", " ", ""], function (props) {
|
|
47
|
+
return props.theme.primaryFontFamily;
|
|
48
|
+
}, function (props) {
|
|
49
|
+
return props.opensSublevel ? '0 8px' : '0 28px 0 8px';
|
|
50
|
+
}, function (props) {
|
|
51
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700'));
|
|
52
|
+
}, function (props) {
|
|
53
|
+
return props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE');
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return !props.icon && styled.css(["padding-left:28px;"]);
|
|
56
|
+
}, function (props) {
|
|
57
|
+
return props.theme.themeProp('border-color', props.theme.getColor('gray-600'), props.theme.getColor('gray-200'));
|
|
58
|
+
}, function (props) {
|
|
59
|
+
return props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('gray-200'));
|
|
60
|
+
}, function (props) {
|
|
61
|
+
return props.hoverColors && props.hoverColors[0] && props.hoverColors[1] && styled.css(["&&:hover{", "}"], function (props) {
|
|
62
|
+
return props.theme.themeProp('color', props.hoverColors[0], props.hoverColors[1]);
|
|
63
|
+
});
|
|
64
|
+
}, function (props) {
|
|
65
|
+
return props.hoverBackgroundColors && props.hoverBackgroundColors[0] && props.hoverBackgroundColors[1] && styled.css(["&&:hover{", "}"], function (props) {
|
|
66
|
+
return props.theme.themeProp('background-color', props.hoverBackgroundColors[0], props.hoverBackgroundColors[1]);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
var IconContainer = styled__default["default"].span.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
70
|
+
displayName: "ContextMenuItemstyled__IconContainer",
|
|
71
|
+
componentId: "sc-16xi8ez-1"
|
|
72
|
+
})(["align-items:center;display:flex;height:fit-content;max-width:12px;margin-right:8px;svg{height:12px;}"]);
|
|
73
|
+
var SublevelIconContainer = styled__default["default"].span.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
74
|
+
displayName: "ContextMenuItemstyled__SublevelIconContainer",
|
|
75
|
+
componentId: "sc-16xi8ez-2"
|
|
76
|
+
})(["align-items:center;display:flex;height:fit-content;max-width:12px;margin-left:auto;margin-right:8px;padding-left:24px;svg{height:12px;}"]);
|
|
77
|
+
|
|
78
|
+
var _excluded = ["title", "icon", "onClickEffect", "opensSublevel", "hoverColors", "hoverBackgroundColors"];
|
|
79
|
+
var ContextMenuItem = React__default["default"].forwardRef(function ContextMenuItem(_ref, forwardedRef) {
|
|
80
|
+
var title = _ref.title,
|
|
81
|
+
icon = _ref.icon,
|
|
82
|
+
onClickEffect = _ref.onClickEffect,
|
|
83
|
+
opensSublevel = _ref.opensSublevel,
|
|
84
|
+
hoverColors = _ref.hoverColors,
|
|
85
|
+
hoverBackgroundColors = _ref.hoverBackgroundColors,
|
|
86
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
87
|
+
return React__default["default"].createElement(ContextMenuItem$1, defaultTheme._extends({
|
|
88
|
+
ref: forwardedRef,
|
|
89
|
+
icon: icon,
|
|
90
|
+
onClick: onClickEffect,
|
|
91
|
+
hoverColors: hoverColors,
|
|
92
|
+
hoverBackgroundColors: hoverBackgroundColors,
|
|
93
|
+
opensSublevel: opensSublevel,
|
|
94
|
+
className: opensSublevel ? 'context-menu-item opens-sublevel' : 'context-menu-item'
|
|
95
|
+
}, props, {
|
|
96
|
+
role: "menuitem"
|
|
97
|
+
}), icon && React__default["default"].createElement(IconContainer, null, icon), React__default["default"].createElement("span", null, title), opensSublevel && React__default["default"].createElement(SublevelIconContainer, null, React__default["default"].createElement(SvgTriangleRight, null)));
|
|
98
|
+
});
|
|
99
|
+
ContextMenuItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
100
|
+
title: defaultTheme.PropTypes.string.isRequired,
|
|
101
|
+
icon: defaultTheme.PropTypes.element,
|
|
102
|
+
onClickEffect: defaultTheme.PropTypes.func,
|
|
103
|
+
opensSublevel: defaultTheme.PropTypes.bool,
|
|
104
|
+
hoverColors: defaultTheme.PropTypes.arrayOf(defaultTheme.PropTypes.string),
|
|
105
|
+
hoverBackgroundColors: defaultTheme.PropTypes.arrayOf(defaultTheme.PropTypes.string)
|
|
106
|
+
} : {};
|
|
107
|
+
ContextMenuItem.defaultProps = {
|
|
108
|
+
icon: undefined,
|
|
109
|
+
hoverColors: undefined,
|
|
110
|
+
hoverBackgroundColors: undefined,
|
|
111
|
+
opensSublevel: false
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
exports.ContextMenuItem = ContextMenuItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-b6420d7d.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
|
|
@@ -9,14 +9,16 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
12
|
+
var InputGroup$1 = styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme).withConfig({
|
|
13
|
+
displayName: "InputGroupstyled__InputGroup",
|
|
14
|
+
componentId: "sc-6p2xv7-0"
|
|
15
|
+
})(["margin:8px 0;"]);
|
|
14
16
|
|
|
15
|
-
var
|
|
17
|
+
var _excluded = ["children"];
|
|
18
|
+
var InputGroup = React__default["default"].forwardRef(function InputGroup(_ref, forwardedRef) {
|
|
16
19
|
var children = _ref.children,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return React__default['default'].createElement(InputGroup$1, defaultTheme._extends({
|
|
20
|
+
props = defaultTheme._objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
return React__default["default"].createElement(InputGroup$1, defaultTheme._extends({
|
|
20
22
|
ref: forwardedRef
|
|
21
23
|
}, props), children);
|
|
22
24
|
});
|