@saleor/macaw-ui 0.3.1 → 0.3.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/dist/ActionBar/styles.d.ts +1 -1
- package/dist/Alert/Alert.d.ts +2 -1
- package/dist/Button/Button.d.ts +1 -3
- package/dist/Pagination/Pagination.d.ts +2 -2
- package/dist/Savebar/styles.d.ts +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +3 -3
- package/dist/icons/Logo.d.ts +1 -1
- package/dist/icons/LogoLight.d.ts +2 -2
- package/dist/icons/index.d.ts +1 -4
- package/dist/index.d.ts +0 -3
- package/dist/index.js +1 -4
- package/dist/index.js.map +3 -3
- package/dist/mjs/index.js +5 -0
- package/dist/mjs/index.js.map +7 -0
- package/dist/theme/createSaleorTheme/overrides/buttons.d.ts +2 -2
- package/dist/theme/createSaleorTheme/overrides/index.d.ts +2 -2
- package/dist/theme/createSaleorTheme/overrides/inputs.d.ts +2 -2
- package/dist/theme/createSaleorTheme/overrides/tables.d.ts +2 -2
- package/dist/theme/createSaleorTheme/shadows.d.ts +2 -2
- package/dist/theme/createSaleorTheme/types.d.ts +4 -8
- package/dist/types/CircleIndicator/CircleIndicator.d.ts +7 -0
- package/dist/types/CircleIndicator/CircleIndicator.stories.d.ts +4 -0
- package/dist/types/CircleIndicator/index.d.ts +1 -0
- package/dist/types/CircleIndicator/styles.d.ts +2 -0
- package/dist/types/ConfirmButton/ConfirmButton.d.ts +1 -1
- package/dist/types/Pill/Pill.d.ts +1 -1
- package/dist/types/StatusChip/styles.d.ts +3 -0
- package/dist/types/icons/CircleIndicatorIcon.d.ts +1 -0
- package/dist/types/icons/SuccessCircleIndicatorIcon.d.ts +1 -0
- package/dist/types/icons/index.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -1
- package/src/ActionBar/styles.ts +1 -1
- package/src/Alert/Alert.tsx +2 -2
- package/src/Backlink/Backlink.stories.tsx +0 -1
- package/src/Backlink/Backlink.tsx +1 -1
- package/src/BaseList/BaseList.tsx +1 -0
- package/src/BaseList/context.ts +1 -0
- package/src/BaseList/styles.ts +1 -0
- package/src/CircleIndicator/CircleIndicator.stories.tsx +48 -0
- package/src/CircleIndicator/CircleIndicator.tsx +34 -0
- package/src/CircleIndicator/index.ts +1 -0
- package/src/CircleIndicator/styles.ts +31 -0
- package/src/ConfirmButton/ConfirmButton.tsx +1 -1
- package/src/Filter/Filter.tsx +1 -3
- package/src/Filter/FilterBar.tsx +0 -1
- package/src/LayoutButton/LayoutButton.tsx +1 -2
- package/src/List/List.stories.tsx +4 -2
- package/src/List/List.tsx +1 -0
- package/src/List/styles.ts +1 -0
- package/src/NavigationCard/NavigationCard.stories.tsx +2 -2
- package/src/NavigationCard/NavigationCard.tsx +1 -1
- package/src/Notification/Notification.tsx +3 -3
- package/src/OffsettedList/OffsettedList.stories.tsx +2 -2
- package/src/OffsettedList/OffsettedList.tsx +1 -0
- package/src/Pill/Pill.stories.tsx +3 -3
- package/src/Pill/Pill.tsx +3 -2
- package/src/PillLink/PillLink.tsx +1 -0
- package/src/Savebar/Savebar.tsx +1 -1
- package/src/Sidebar/ExpandButton.tsx +1 -1
- package/src/StatusChip/StatusChip.tsx +1 -1
- package/src/UserChipMenu/UserChipMenu.tsx +1 -1
- package/src/consts.ts +1 -0
- package/src/icons/CircleIndicatorIcon.tsx +10 -0
- package/src/icons/SuccessCircleIndicatorIcon.tsx +16 -0
- package/src/icons/index.ts +2 -0
- package/src/index.tsx +1 -0
- package/src/theme/ThemeProvider.tsx +0 -1
- package/src/theme/createSaleorTheme/createSaleorTheme.tsx +2 -2
- package/src/theme/createSaleorTheme/overrides/inputs.ts +1 -1
- package/src/theme/utils.test.ts +4 -4
- package/src/theme/utils.ts +1 -1
- package/src/tools/useLocalStorage.ts +16 -9
- package/dist/macaw-ui.cjs.development.js +0 -2626
- package/dist/macaw-ui.cjs.development.js.map +0 -1
- package/dist/macaw-ui.cjs.production.min.js +0 -2
- package/dist/macaw-ui.cjs.production.min.js.map +0 -1
- package/dist/macaw-ui.esm.js +0 -2578
- package/dist/macaw-ui.esm.js.map +0 -1
- package/dist/types/Button/Button.stories.d.ts +0 -5
package/dist/macaw-ui.esm.js
DELETED
|
@@ -1,2578 +0,0 @@
|
|
|
1
|
-
import { makeStyles as makeStyles$1, useTheme as useTheme$1, fade, darken, createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';
|
|
2
|
-
import { merge, throttle } from 'lodash-es';
|
|
3
|
-
import React, { useEffect, useState, useCallback, useContext, createContext } from 'react';
|
|
4
|
-
import CssBaseline from '@material-ui/core/CssBaseline';
|
|
5
|
-
import { createSvgIcon } from '@material-ui/core/utils';
|
|
6
|
-
import Button from '@material-ui/core/Button';
|
|
7
|
-
import Card from '@material-ui/core/Card';
|
|
8
|
-
import CardContent from '@material-ui/core/CardContent';
|
|
9
|
-
import Container from '@material-ui/core/Container';
|
|
10
|
-
import Portal from '@material-ui/core/Portal';
|
|
11
|
-
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
12
|
-
import CheckIcon from '@material-ui/icons/Check';
|
|
13
|
-
import clsx from 'clsx';
|
|
14
|
-
import Tooltip$1 from '@material-ui/core/Tooltip';
|
|
15
|
-
import Typography from '@material-ui/core/Typography';
|
|
16
|
-
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
|
17
|
-
import Skeleton from '@material-ui/lab/Skeleton';
|
|
18
|
-
import ButtonBase from '@material-ui/core/ButtonBase';
|
|
19
|
-
import ClickAwayListener from '@material-ui/core/ClickAwayListener';
|
|
20
|
-
import Paper from '@material-ui/core/Paper';
|
|
21
|
-
import Popper from '@material-ui/core/Popper';
|
|
22
|
-
import SVG from 'react-inlinesvg';
|
|
23
|
-
import Drawer from '@material-ui/core/Drawer';
|
|
24
|
-
import ArrowLeftIcon from '@material-ui/icons/ArrowLeft';
|
|
25
|
-
import MenuIcon from '@material-ui/icons/Menu';
|
|
26
|
-
import IconButton from '@material-ui/core/IconButton';
|
|
27
|
-
import CloseIcon from '@material-ui/icons/Close';
|
|
28
|
-
import SnackbarContent from '@material-ui/core/SnackbarContent';
|
|
29
|
-
import Avatar from '@material-ui/core/Avatar';
|
|
30
|
-
import Chip from '@material-ui/core/Chip';
|
|
31
|
-
import Grow from '@material-ui/core/Grow';
|
|
32
|
-
import Hidden from '@material-ui/core/Hidden';
|
|
33
|
-
import Menu from '@material-ui/core/MenuList';
|
|
34
|
-
import MenuItem$1 from '@material-ui/core/MenuItem';
|
|
35
|
-
import Table from '@material-ui/core/Table';
|
|
36
|
-
import { Tooltip as Tooltip$2 } from '@material-ui/core';
|
|
37
|
-
|
|
38
|
-
function _extends() {
|
|
39
|
-
_extends = Object.assign || function (target) {
|
|
40
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
41
|
-
var source = arguments[i];
|
|
42
|
-
|
|
43
|
-
for (var key in source) {
|
|
44
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
45
|
-
target[key] = source[key];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return target;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return _extends.apply(this, arguments);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
57
|
-
if (source == null) return {};
|
|
58
|
-
var target = {};
|
|
59
|
-
var sourceKeys = Object.keys(source);
|
|
60
|
-
var key, i;
|
|
61
|
-
|
|
62
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
63
|
-
key = sourceKeys[i];
|
|
64
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
65
|
-
target[key] = source[key];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return target;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
var ActionBarContext = /*#__PURE__*/React.createContext(undefined);
|
|
72
|
-
ActionBarContext.displayName = "ActionBarContext";
|
|
73
|
-
var useActionBar = function useActionBar() {
|
|
74
|
-
var ctx = React.useContext(ActionBarContext);
|
|
75
|
-
|
|
76
|
-
if (ctx === undefined) {
|
|
77
|
-
throw new Error("useActionBar must be used within a ActionBarContext");
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return ctx;
|
|
81
|
-
};
|
|
82
|
-
var ActionBarProvider = function ActionBarProvider(_ref) {
|
|
83
|
-
var children = _ref.children;
|
|
84
|
-
|
|
85
|
-
var _React$useState = React.useState(true),
|
|
86
|
-
docked = _React$useState[0],
|
|
87
|
-
setDocked = _React$useState[1];
|
|
88
|
-
|
|
89
|
-
var anchor = React.useRef(null);
|
|
90
|
-
return React.createElement(ActionBarContext.Provider, {
|
|
91
|
-
value: {
|
|
92
|
-
anchor: anchor,
|
|
93
|
-
docked: docked,
|
|
94
|
-
setDocked: setDocked
|
|
95
|
-
}
|
|
96
|
-
}, children);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
var BacklinkContext = /*#__PURE__*/React.createContext(undefined);
|
|
100
|
-
BacklinkContext.displayName = "BacklinkContext";
|
|
101
|
-
var useBacklink = function useBacklink() {
|
|
102
|
-
var ctx = React.useContext(BacklinkContext);
|
|
103
|
-
|
|
104
|
-
if (ctx === undefined) {
|
|
105
|
-
throw new Error("useBacklink must be used within a BacklinkContext");
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return ctx;
|
|
109
|
-
};
|
|
110
|
-
var BacklinkProvider = function BacklinkProvider(_ref) {
|
|
111
|
-
var children = _ref.children;
|
|
112
|
-
var anchor = React.useRef(null);
|
|
113
|
-
return React.createElement(BacklinkContext.Provider, {
|
|
114
|
-
value: anchor
|
|
115
|
-
}, children);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
function sendMessageToDashboard(message, targetOrigin) {
|
|
119
|
-
if (!!window.parent) {
|
|
120
|
-
window.parent.postMessage(message, targetOrigin);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
function sendMessageToExtension(message, targetOrigin) {
|
|
124
|
-
var appFrame = document.querySelector("#extension-app");
|
|
125
|
-
|
|
126
|
-
if (!!(appFrame != null && appFrame.contentWindow)) {
|
|
127
|
-
appFrame.contentWindow.postMessage(message, targetOrigin);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
var ExtensionMessageType;
|
|
132
|
-
|
|
133
|
-
(function (ExtensionMessageType) {
|
|
134
|
-
ExtensionMessageType[ExtensionMessageType["BREADCRUMB_CLICK"] = 0] = "BREADCRUMB_CLICK";
|
|
135
|
-
ExtensionMessageType[ExtensionMessageType["BREADCRUMB_SET"] = 1] = "BREADCRUMB_SET";
|
|
136
|
-
ExtensionMessageType[ExtensionMessageType["THEME"] = 2] = "THEME";
|
|
137
|
-
})(ExtensionMessageType || (ExtensionMessageType = {}));
|
|
138
|
-
|
|
139
|
-
function useExtensionMessage(handle) {
|
|
140
|
-
useEffect(function () {
|
|
141
|
-
window.addEventListener("message", handle);
|
|
142
|
-
return function () {
|
|
143
|
-
return window.removeEventListener("message", handle);
|
|
144
|
-
};
|
|
145
|
-
}, [handle]);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
var localStorageKeys = {
|
|
149
|
-
theme: "macaw-ui-theme",
|
|
150
|
-
menuShrink: "macaw-ui-menu-shrink"
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// Copied directly from
|
|
154
|
-
function useLocalStorage(key, initialValue) {
|
|
155
|
-
if (initialValue === void 0) {
|
|
156
|
-
initialValue = "";
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
var _useState = useState(function () {
|
|
160
|
-
return window.localStorage.getItem(key) || initialValue;
|
|
161
|
-
}),
|
|
162
|
-
value = _useState[0],
|
|
163
|
-
setValue = _useState[1];
|
|
164
|
-
|
|
165
|
-
var setItem = function setItem(newValue) {
|
|
166
|
-
setValue(newValue);
|
|
167
|
-
window.localStorage.setItem(key, newValue);
|
|
168
|
-
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
useEffect(function () {
|
|
172
|
-
var newValue = window.localStorage.getItem(key);
|
|
173
|
-
|
|
174
|
-
if (value !== newValue) {
|
|
175
|
-
setValue(newValue || initialValue);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
var handleStorage = useCallback(function (event) {
|
|
179
|
-
if (event.key === key && event.newValue !== value) {
|
|
180
|
-
setValue(event.newValue || initialValue);
|
|
181
|
-
}
|
|
182
|
-
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
183
|
-
[value, key]);
|
|
184
|
-
useEffect(function () {
|
|
185
|
-
window.addEventListener("storage", handleStorage);
|
|
186
|
-
return function () {
|
|
187
|
-
return window.removeEventListener("storage", handleStorage);
|
|
188
|
-
};
|
|
189
|
-
}, [handleStorage]);
|
|
190
|
-
return {
|
|
191
|
-
value: value,
|
|
192
|
-
setValue: setItem
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
var ThemeContext = /*#__PURE__*/React.createContext(undefined);
|
|
197
|
-
ThemeContext.displayName = "ThemeContext";
|
|
198
|
-
|
|
199
|
-
function makeStyles(styles, options) {
|
|
200
|
-
return makeStyles$1(styles, options);
|
|
201
|
-
}
|
|
202
|
-
function useTheme() {
|
|
203
|
-
var saleorTheme = useTheme$1();
|
|
204
|
-
var themeInfo = useContext(ThemeContext);
|
|
205
|
-
|
|
206
|
-
if (themeInfo === undefined || saleorTheme === undefined) {
|
|
207
|
-
throw new Error("useTheme must be used within a ThemeProvider");
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return _extends({}, saleorTheme, themeInfo);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
var useStyles = /*#__PURE__*/makeStyles(function (theme) {
|
|
214
|
-
return {
|
|
215
|
-
"@global": {
|
|
216
|
-
"@import": "url('https://rsms.me/inter/inter.css')",
|
|
217
|
-
// For some reason @import clause must be put on top
|
|
218
|
-
// eslint-disable-next-line sort-keys
|
|
219
|
-
"::selection": {
|
|
220
|
-
background: fade(theme.palette.primary.main, 0.2)
|
|
221
|
-
},
|
|
222
|
-
html: {
|
|
223
|
-
fontSize: "62.5%"
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
}, {
|
|
228
|
-
name: "Baseline"
|
|
229
|
-
});
|
|
230
|
-
var Baseline = function Baseline() {
|
|
231
|
-
useStyles();
|
|
232
|
-
return React.createElement(CssBaseline, null);
|
|
233
|
-
};
|
|
234
|
-
Baseline.displayName = "Baseline";
|
|
235
|
-
|
|
236
|
-
var buttonOverrides = function buttonOverrides(colors) {
|
|
237
|
-
return {
|
|
238
|
-
MuiButton: {
|
|
239
|
-
contained: {
|
|
240
|
-
"&$disabled": {
|
|
241
|
-
backgroundColor: fade(colors.primary, 0.12),
|
|
242
|
-
color: "#FFFFFF"
|
|
243
|
-
},
|
|
244
|
-
"&:active": {
|
|
245
|
-
boxShadow: "none"
|
|
246
|
-
},
|
|
247
|
-
"&:hover": {
|
|
248
|
-
boxShadow: "none"
|
|
249
|
-
},
|
|
250
|
-
boxShadow: "none"
|
|
251
|
-
},
|
|
252
|
-
containedPrimary: {
|
|
253
|
-
"&:active": {
|
|
254
|
-
backgroundColor: darken(colors.primary, 0.4)
|
|
255
|
-
},
|
|
256
|
-
"&:hover": {
|
|
257
|
-
backgroundColor: darken(colors.primary, 0.1)
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
label: {
|
|
261
|
-
fontWeight: 600
|
|
262
|
-
},
|
|
263
|
-
root: {
|
|
264
|
-
"& svg": {
|
|
265
|
-
marginLeft: 8
|
|
266
|
-
},
|
|
267
|
-
borderRadius: 4
|
|
268
|
-
},
|
|
269
|
-
textPrimary: {
|
|
270
|
-
"&:not($disabled) span": {
|
|
271
|
-
color: colors.primary
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
textSizeSmall: {
|
|
275
|
-
fontSize: "1.3rem"
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
MuiIconButton: {
|
|
279
|
-
root: {
|
|
280
|
-
"&:hover": {
|
|
281
|
-
backgroundColor: fade(colors.primary, 0.12)
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
MuiSwitch: {
|
|
286
|
-
colorPrimary: {
|
|
287
|
-
"&$checked": {
|
|
288
|
-
color: colors.background.paper
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
root: {
|
|
292
|
-
"&$disabled": {
|
|
293
|
-
"&$switchBase": {
|
|
294
|
-
"& + $thumb": {
|
|
295
|
-
backgroundColor: colors.gray.disabled
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
height: 48,
|
|
300
|
-
width: 72
|
|
301
|
-
},
|
|
302
|
-
switchBase: {
|
|
303
|
-
"&$checked": {
|
|
304
|
-
transform: "translateX(23px)"
|
|
305
|
-
},
|
|
306
|
-
boxShadow: "none",
|
|
307
|
-
left: 1,
|
|
308
|
-
marginLeft: 4,
|
|
309
|
-
top: 5
|
|
310
|
-
},
|
|
311
|
-
thumb: {
|
|
312
|
-
boxShadow: "none"
|
|
313
|
-
},
|
|
314
|
-
track: {
|
|
315
|
-
"$colorPrimary$checked + &": {
|
|
316
|
-
backgroundColor: colors.primary
|
|
317
|
-
},
|
|
318
|
-
backgroundColor: colors.gray["default"],
|
|
319
|
-
borderRadius: 12,
|
|
320
|
-
height: 24,
|
|
321
|
-
opacity: [["1"], "!important"],
|
|
322
|
-
width: 48
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
var inputOverrides = function inputOverrides(colors) {
|
|
329
|
-
return {
|
|
330
|
-
MuiInput: {
|
|
331
|
-
input: {
|
|
332
|
-
"&:-webkit-autofill": {
|
|
333
|
-
WebkitTextFillColor: colors.font["default"],
|
|
334
|
-
boxShadow: "inset 0 0 0px 9999px " + colors.autofill
|
|
335
|
-
},
|
|
336
|
-
"&::placeholder": {
|
|
337
|
-
opacity: "1 !important"
|
|
338
|
-
},
|
|
339
|
-
color: colors.font["default"]
|
|
340
|
-
},
|
|
341
|
-
underline: {
|
|
342
|
-
"&:after": {
|
|
343
|
-
borderBottomColor: colors.primary
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
MuiInputBase: {
|
|
348
|
-
input: {
|
|
349
|
-
"&$disabled": {
|
|
350
|
-
color: colors.input.disabledText
|
|
351
|
-
},
|
|
352
|
-
"&::placeholder": {
|
|
353
|
-
color: colors.font.gray,
|
|
354
|
-
opacity: "1 !important"
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
MuiInputLabel: {
|
|
359
|
-
formControl: {
|
|
360
|
-
transform: "translate(0, 1.5px) scale(0.75)",
|
|
361
|
-
transformOrigin: "top left",
|
|
362
|
-
width: "100%"
|
|
363
|
-
},
|
|
364
|
-
outlined: {
|
|
365
|
-
"&$shrink": {
|
|
366
|
-
transform: "translate(12px, 9px) scale(0.75)"
|
|
367
|
-
},
|
|
368
|
-
transform: "translate(14px, 18px) scale(1)"
|
|
369
|
-
},
|
|
370
|
-
root: {
|
|
371
|
-
"&$disabled": {
|
|
372
|
-
color: fade(colors.primary, 0.4) + " !important"
|
|
373
|
-
},
|
|
374
|
-
"&$error": {
|
|
375
|
-
"&$focused": {
|
|
376
|
-
color: colors.error
|
|
377
|
-
},
|
|
378
|
-
color: colors.error
|
|
379
|
-
},
|
|
380
|
-
"&&$focused": {
|
|
381
|
-
"&:not($error)": {
|
|
382
|
-
color: colors.primary
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
color: fade(colors.input.text, 0.6)
|
|
386
|
-
},
|
|
387
|
-
shrink: {
|
|
388
|
-
// Negates x0.75 scale
|
|
389
|
-
width: "133%"
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
MuiOutlinedInput: {
|
|
393
|
-
input: {
|
|
394
|
-
"&:-webkit-autofill": {
|
|
395
|
-
borderRadius: 4,
|
|
396
|
-
boxShadow: "0 0 0px 1000px rgba(19, 190, 187, 0.1) inset"
|
|
397
|
-
},
|
|
398
|
-
color: colors.input.text,
|
|
399
|
-
padding: "23px 12px 10px 12px"
|
|
400
|
-
},
|
|
401
|
-
inputMultiline: {
|
|
402
|
-
left: -2,
|
|
403
|
-
padding: "10px 0",
|
|
404
|
-
position: "relative"
|
|
405
|
-
},
|
|
406
|
-
root: {
|
|
407
|
-
"& fieldset": {
|
|
408
|
-
"&&:not($error)": {
|
|
409
|
-
borderColor: colors.input.border
|
|
410
|
-
},
|
|
411
|
-
top: 0
|
|
412
|
-
},
|
|
413
|
-
"& legend": {
|
|
414
|
-
display: "none"
|
|
415
|
-
},
|
|
416
|
-
"&$disabled": {
|
|
417
|
-
"& fieldset": {
|
|
418
|
-
borderColor: [[colors.input.disabled], "!important"]
|
|
419
|
-
},
|
|
420
|
-
"& input": {
|
|
421
|
-
backgroundColor: colors.input.disabledBackground,
|
|
422
|
-
color: colors.input.disabledText
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
"&$error": {
|
|
426
|
-
"&$focused": {
|
|
427
|
-
"& fieldset": {
|
|
428
|
-
borderColor: colors.error
|
|
429
|
-
},
|
|
430
|
-
"& input": {
|
|
431
|
-
color: colors.error
|
|
432
|
-
}
|
|
433
|
-
},
|
|
434
|
-
"&:hover": {
|
|
435
|
-
"& fieldset": {
|
|
436
|
-
borderColor: colors.error
|
|
437
|
-
},
|
|
438
|
-
"& input": {
|
|
439
|
-
color: colors.error
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
},
|
|
443
|
-
"&$focused": {
|
|
444
|
-
"& input": {
|
|
445
|
-
"& fieldset": {
|
|
446
|
-
borderColor: colors.primary
|
|
447
|
-
},
|
|
448
|
-
"&::placeholder": {
|
|
449
|
-
opacity: [[1], "!important"]
|
|
450
|
-
},
|
|
451
|
-
color: colors.font["default"]
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
"&:hover": {
|
|
455
|
-
"& input": {
|
|
456
|
-
color: colors.font["default"]
|
|
457
|
-
},
|
|
458
|
-
"&&&": {
|
|
459
|
-
"& fieldset": {
|
|
460
|
-
borderColor: colors.primary
|
|
461
|
-
},
|
|
462
|
-
"&$error fieldset": {
|
|
463
|
-
borderColor: colors.input.error
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
backgroundColor: colors.background.paper,
|
|
468
|
-
borderColor: colors.input.border,
|
|
469
|
-
top: 0
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
};
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
var tableOverrides = function tableOverrides(colors, fontFamily) {
|
|
476
|
-
return {
|
|
477
|
-
MuiTable: {
|
|
478
|
-
root: {
|
|
479
|
-
fontFamily: fontFamily,
|
|
480
|
-
fontFeatureSettings: '"tnum"'
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
MuiTableCell: {
|
|
484
|
-
body: {
|
|
485
|
-
fontSize: "1.6rem"
|
|
486
|
-
},
|
|
487
|
-
head: {
|
|
488
|
-
fontSize: "1.4rem",
|
|
489
|
-
fontWeight: 400,
|
|
490
|
-
color: colors.font.textDisabled
|
|
491
|
-
},
|
|
492
|
-
paddingCheckbox: {
|
|
493
|
-
"&:first-child": {
|
|
494
|
-
padding: "0 12px",
|
|
495
|
-
width: 72
|
|
496
|
-
},
|
|
497
|
-
"&:not(first-child)": {
|
|
498
|
-
padding: 0,
|
|
499
|
-
width: 52
|
|
500
|
-
}
|
|
501
|
-
},
|
|
502
|
-
root: {
|
|
503
|
-
"&:first-child": {
|
|
504
|
-
"&:not($paddingCheckbox)": {
|
|
505
|
-
paddingLeft: 24 + "px",
|
|
506
|
-
textAlign: "left"
|
|
507
|
-
}
|
|
508
|
-
},
|
|
509
|
-
borderBottomColor: colors.paperBorder,
|
|
510
|
-
padding: "16px 24px"
|
|
511
|
-
}
|
|
512
|
-
},
|
|
513
|
-
MuiTablePagination: {
|
|
514
|
-
input: {
|
|
515
|
-
color: colors.primary,
|
|
516
|
-
fontSize: "1.4rem"
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
MuiTableRow: {
|
|
520
|
-
footer: {
|
|
521
|
-
"$root$hover&:hover": {
|
|
522
|
-
background: "none"
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
head: {
|
|
526
|
-
"$root$hover&:hover": {
|
|
527
|
-
background: "none"
|
|
528
|
-
}
|
|
529
|
-
},
|
|
530
|
-
hover: {
|
|
531
|
-
"$root&:hover": {
|
|
532
|
-
backgroundColor: fade(colors.primary, 0.3)
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
root: {
|
|
536
|
-
"&$selected": {
|
|
537
|
-
backgroundColor: fade(colors.primary, 0.05)
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
};
|
|
542
|
-
};
|
|
543
|
-
|
|
544
|
-
var overrides = function overrides(colors, fontFamily) {
|
|
545
|
-
return _extends({}, inputOverrides(colors), tableOverrides(colors, fontFamily), buttonOverrides(colors));
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
var createPalette = function createPalette(colors) {
|
|
549
|
-
return {
|
|
550
|
-
action: {
|
|
551
|
-
active: colors.checkbox["default"]
|
|
552
|
-
},
|
|
553
|
-
alert: colors.alert,
|
|
554
|
-
background: colors.background,
|
|
555
|
-
divider: colors.divider,
|
|
556
|
-
error: {
|
|
557
|
-
main: colors.error
|
|
558
|
-
},
|
|
559
|
-
primary: {
|
|
560
|
-
contrastText: "#ffffff",
|
|
561
|
-
dark: colors.font.textDisabled,
|
|
562
|
-
main: colors.primary
|
|
563
|
-
},
|
|
564
|
-
secondary: {
|
|
565
|
-
contrastText: "#ffffff",
|
|
566
|
-
main: colors.secondary
|
|
567
|
-
},
|
|
568
|
-
success: {
|
|
569
|
-
main: colors.success
|
|
570
|
-
},
|
|
571
|
-
text: {
|
|
572
|
-
disabled: colors.font.gray,
|
|
573
|
-
hint: colors.font.gray,
|
|
574
|
-
primary: colors.font["default"],
|
|
575
|
-
secondary: colors.font.gray
|
|
576
|
-
},
|
|
577
|
-
textHighlighted: {
|
|
578
|
-
active: colors.primary,
|
|
579
|
-
inactive: colors.highlightInactive["default"]
|
|
580
|
-
},
|
|
581
|
-
type: colors.theme
|
|
582
|
-
};
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
var createShadow = function createShadow(pv, pb, ps, uv, ub, us, av, ab, as) {
|
|
586
|
-
return ["0 " + pv + "px " + pb + "px " + ps + "px rgba(0, 0, 0, 0.2)", "0 " + uv + "px " + ub + "px " + us + "px rgba(0, 0, 0, 0.14)", "0 " + av + "px " + ab + "px " + as + "px rgba(0, 0, 0, 0.12)"].join(",");
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
var shadows = ["none", /*#__PURE__*/createShadow(1, 1, 0, 2, 1, -2, 1, 3, 0), /*#__PURE__*/createShadow(2, 2, 0, 3, 1, -2, 1, 5, 0), /*#__PURE__*/createShadow(3, 4, 0, 3, 3, -2, 1, 8, 0), /*#__PURE__*/createShadow(4, 5, 0, 1, 10, 0, 2, 4, -1), /*#__PURE__*/createShadow(5, 8, 0, 1, 14, 0, 3, 4, -1), /*#__PURE__*/createShadow(6, 10, 0, 1, 18, 0, 3, 5, -1), /*#__PURE__*/createShadow(7, 10, 0, 2, 16, 1, 4, 5, -2), /*#__PURE__*/createShadow(8, 10, 1, 3, 14, 2, 5, 5, -3), /*#__PURE__*/createShadow(9, 12, 1, 3, 16, 3, 5, 6, -4), /*#__PURE__*/createShadow(10, 14, 1, 4, 18, 3, 6, 7, -4), /*#__PURE__*/createShadow(11, 16, 1, 4, 20, 3, 6, 7, -4), /*#__PURE__*/createShadow(12, 17, 1, 5, 22, 4, 7, 8, -4), /*#__PURE__*/createShadow(13, 19, 1, 5, 24, 4, 7, 8, -4), /*#__PURE__*/createShadow(14, 21, 1, 5, 26, 4, 7, 9, -5), /*#__PURE__*/createShadow(15, 22, 1, 5, 28, 4, 7, 9, -5), /*#__PURE__*/createShadow(16, 24, 2, 6, 30, 5, 8, 10, -5), /*#__PURE__*/createShadow(15, 27, 3, 7, 28, 3, 10, 14, -4), /*#__PURE__*/createShadow(14, 30, 4, 8, 26, 1, 12, 17, -3), /*#__PURE__*/createShadow(13, 33, 4, 8, 24, -1, 14, 20, -1), /*#__PURE__*/createShadow(12, 36, 5, 9, 22, -2, 16, 24, 1), /*#__PURE__*/createShadow(11, 39, 6, 10, 20, -4, 18, 28, 1), /*#__PURE__*/createShadow(10, 41, 7, 10, 18, -5, 20, 31, 2), /*#__PURE__*/createShadow(9, 44, 7, 11, 16, -6, 22, 35, 2), /*#__PURE__*/createShadow(9, 46, 8, 11, 15, -7, 24, 38, 3)];
|
|
590
|
-
|
|
591
|
-
var ICONBUTTON_SIZE = 48;
|
|
592
|
-
var fontFamily = '"Inter", "roboto", "sans-serif"';
|
|
593
|
-
var createTheme = function createTheme(colors) {
|
|
594
|
-
return createMuiTheme({
|
|
595
|
-
overrides: _extends({}, overrides(colors, fontFamily), {
|
|
596
|
-
MuiCard: {
|
|
597
|
-
root: {
|
|
598
|
-
borderColor: colors.paperBorder,
|
|
599
|
-
borderRadius: 8,
|
|
600
|
-
borderStyle: "solid",
|
|
601
|
-
borderWidth: 1,
|
|
602
|
-
overflow: "visible"
|
|
603
|
-
}
|
|
604
|
-
},
|
|
605
|
-
MuiCardActions: {
|
|
606
|
-
root: {
|
|
607
|
-
flexDirection: "row-reverse"
|
|
608
|
-
}
|
|
609
|
-
},
|
|
610
|
-
MuiCardContent: {
|
|
611
|
-
root: {
|
|
612
|
-
padding: "2.4rem"
|
|
613
|
-
}
|
|
614
|
-
},
|
|
615
|
-
MuiCardHeader: {
|
|
616
|
-
action: {
|
|
617
|
-
position: "relative",
|
|
618
|
-
top: 4
|
|
619
|
-
},
|
|
620
|
-
root: {
|
|
621
|
-
padding: "1.6rem 2.4rem"
|
|
622
|
-
}
|
|
623
|
-
},
|
|
624
|
-
MuiChip: {
|
|
625
|
-
avatar: {
|
|
626
|
-
fontSize: "1.2rem",
|
|
627
|
-
height: 32,
|
|
628
|
-
left: -5,
|
|
629
|
-
position: "relative",
|
|
630
|
-
width: 32
|
|
631
|
-
},
|
|
632
|
-
root: {
|
|
633
|
-
"& $avatar": {
|
|
634
|
-
fontSize: "1.2rem"
|
|
635
|
-
},
|
|
636
|
-
fontSize: "1.3rem"
|
|
637
|
-
}
|
|
638
|
-
},
|
|
639
|
-
MuiDialog: {
|
|
640
|
-
paper: {
|
|
641
|
-
overflowY: undefined
|
|
642
|
-
}
|
|
643
|
-
},
|
|
644
|
-
MuiDialogActions: {
|
|
645
|
-
root: {
|
|
646
|
-
borderTop: "1px solid " + colors.divider,
|
|
647
|
-
padding: "16px 24px"
|
|
648
|
-
}
|
|
649
|
-
},
|
|
650
|
-
MuiDialogContent: {
|
|
651
|
-
root: {
|
|
652
|
-
overflowX: undefined,
|
|
653
|
-
overflowY: undefined,
|
|
654
|
-
padding: "24px 0px",
|
|
655
|
-
margin: "0px 24px"
|
|
656
|
-
}
|
|
657
|
-
},
|
|
658
|
-
MuiDialogContentText: {
|
|
659
|
-
root: {
|
|
660
|
-
"&:last-child": {
|
|
661
|
-
marginBottom: 0
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
MuiDialogTitle: {
|
|
666
|
-
root: {
|
|
667
|
-
borderBottom: "1px solid " + colors.divider
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
MuiFormControlLabel: {
|
|
671
|
-
label: {
|
|
672
|
-
lineHeight: 1.2,
|
|
673
|
-
marginLeft: 4
|
|
674
|
-
}
|
|
675
|
-
},
|
|
676
|
-
MuiFormLabel: {
|
|
677
|
-
filled: {
|
|
678
|
-
"&&:not($error)": {
|
|
679
|
-
color: colors.primary
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
root: {
|
|
683
|
-
"&&$focused:not($error)": {
|
|
684
|
-
color: colors.font.gray
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
},
|
|
688
|
-
MuiSvgIcon: {
|
|
689
|
-
root: {
|
|
690
|
-
fontSize: "2.4rem",
|
|
691
|
-
height: "1em",
|
|
692
|
-
width: "1em"
|
|
693
|
-
}
|
|
694
|
-
},
|
|
695
|
-
MuiList: {
|
|
696
|
-
root: {
|
|
697
|
-
display: "grid",
|
|
698
|
-
gridRowGap: 8 + "px",
|
|
699
|
-
padding: "8px !important"
|
|
700
|
-
}
|
|
701
|
-
},
|
|
702
|
-
MuiListItem: {
|
|
703
|
-
button: {
|
|
704
|
-
"&:focus": {
|
|
705
|
-
backgroundColor: colors.input["default"]
|
|
706
|
-
}
|
|
707
|
-
},
|
|
708
|
-
root: {
|
|
709
|
-
"&$selected": {
|
|
710
|
-
"&:hover": {
|
|
711
|
-
backgroundColor: colors.input["default"]
|
|
712
|
-
},
|
|
713
|
-
backgroundColor: colors.input["default"]
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
},
|
|
717
|
-
MuiMenu: {
|
|
718
|
-
paper: {
|
|
719
|
-
borderRadius: 8
|
|
720
|
-
}
|
|
721
|
-
},
|
|
722
|
-
MuiMenuItem: {
|
|
723
|
-
root: {
|
|
724
|
-
"&$selected, &$selected:focus, &$selected:hover": {
|
|
725
|
-
backgroundColor: [colors.background["default"], "!important"],
|
|
726
|
-
color: colors.primary,
|
|
727
|
-
fontWeight: 700
|
|
728
|
-
},
|
|
729
|
-
"&:hover": {
|
|
730
|
-
backgroundColor: [colors.background["default"], "!important"],
|
|
731
|
-
color: colors.font["default"],
|
|
732
|
-
fontWeight: 400
|
|
733
|
-
},
|
|
734
|
-
borderRadius: 4
|
|
735
|
-
}
|
|
736
|
-
},
|
|
737
|
-
MuiSelect: {
|
|
738
|
-
root: {
|
|
739
|
-
"&$disabled": {
|
|
740
|
-
backgroundColor: colors.input.disabledBackground
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
},
|
|
744
|
-
MuiSnackbarContent: {
|
|
745
|
-
action: {
|
|
746
|
-
"& $MuiIconButton": {
|
|
747
|
-
"& svg": {
|
|
748
|
-
color: colors.font["default"]
|
|
749
|
-
}
|
|
750
|
-
},
|
|
751
|
-
display: "block",
|
|
752
|
-
paddingBottom: 10,
|
|
753
|
-
paddingLeft: 0,
|
|
754
|
-
paddingRight: 45
|
|
755
|
-
},
|
|
756
|
-
message: {
|
|
757
|
-
fontSize: 16
|
|
758
|
-
},
|
|
759
|
-
root: {
|
|
760
|
-
backgroundColor: colors.background.paper,
|
|
761
|
-
boxShadow: "0 6px 10px 0px rgba(0, 0, 0, 0.15), 0 1px 18px 0px rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.10)",
|
|
762
|
-
color: colors.font["default"],
|
|
763
|
-
display: "block",
|
|
764
|
-
maxWidth: 480
|
|
765
|
-
}
|
|
766
|
-
},
|
|
767
|
-
MuiTooltip: {
|
|
768
|
-
tooltip: {
|
|
769
|
-
fontSize: "0.8em"
|
|
770
|
-
}
|
|
771
|
-
},
|
|
772
|
-
MuiTouchRipple: {
|
|
773
|
-
child: {
|
|
774
|
-
backgroundColor: fade(colors.primary, 0.2)
|
|
775
|
-
},
|
|
776
|
-
childLeaving: {
|
|
777
|
-
backgroundColor: fade(colors.primary, 0.2)
|
|
778
|
-
},
|
|
779
|
-
ripple: {
|
|
780
|
-
"&$rippleVisible": {
|
|
781
|
-
backgroundColor: fade(colors.primary, 0.2)
|
|
782
|
-
},
|
|
783
|
-
borderRadius: "100%"
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
}),
|
|
787
|
-
palette: createPalette(colors),
|
|
788
|
-
props: {
|
|
789
|
-
MuiFormControl: {
|
|
790
|
-
variant: "filled"
|
|
791
|
-
},
|
|
792
|
-
MuiTextField: {
|
|
793
|
-
variant: "outlined"
|
|
794
|
-
},
|
|
795
|
-
MuiCard: {
|
|
796
|
-
elevation: 0
|
|
797
|
-
},
|
|
798
|
-
MuiTypography: {
|
|
799
|
-
component: "div"
|
|
800
|
-
},
|
|
801
|
-
MuiCheckbox: {
|
|
802
|
-
color: "primary"
|
|
803
|
-
},
|
|
804
|
-
MuiTooltip: {
|
|
805
|
-
placement: "right-end"
|
|
806
|
-
}
|
|
807
|
-
},
|
|
808
|
-
shadows: shadows,
|
|
809
|
-
spacing: function spacing(value) {
|
|
810
|
-
if (value === void 0) {
|
|
811
|
-
value = 1;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
return value * 8 / 10 + "rem";
|
|
815
|
-
},
|
|
816
|
-
typography: {
|
|
817
|
-
allVariants: {
|
|
818
|
-
fontFamily: fontFamily
|
|
819
|
-
},
|
|
820
|
-
body1: {
|
|
821
|
-
color: colors.font["default"],
|
|
822
|
-
fontSize: "1.6rem"
|
|
823
|
-
},
|
|
824
|
-
body2: {
|
|
825
|
-
fontSize: "1.4rem"
|
|
826
|
-
},
|
|
827
|
-
button: {
|
|
828
|
-
fontSize: "1.4rem"
|
|
829
|
-
},
|
|
830
|
-
caption: {
|
|
831
|
-
fontSize: "1.2rem"
|
|
832
|
-
},
|
|
833
|
-
fontFamily: fontFamily,
|
|
834
|
-
h1: {
|
|
835
|
-
fontSize: "4.8rem",
|
|
836
|
-
fontWeight: 700
|
|
837
|
-
},
|
|
838
|
-
h4: {
|
|
839
|
-
fontSize: "3.4rem",
|
|
840
|
-
color: colors.font["default"]
|
|
841
|
-
},
|
|
842
|
-
h5: {
|
|
843
|
-
fontSize: "2.1rem",
|
|
844
|
-
fontWeight: 500
|
|
845
|
-
},
|
|
846
|
-
h6: {
|
|
847
|
-
fontSize: "2rem",
|
|
848
|
-
fontWeight: 500
|
|
849
|
-
},
|
|
850
|
-
subtitle1: {
|
|
851
|
-
fontSize: "1.6rem"
|
|
852
|
-
},
|
|
853
|
-
subtitle2: {
|
|
854
|
-
fontSize: "1.4rem"
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
});
|
|
858
|
-
};
|
|
859
|
-
|
|
860
|
-
var dark = {
|
|
861
|
-
alert: {
|
|
862
|
-
paper: {
|
|
863
|
-
error: "#E0444E",
|
|
864
|
-
info: "#2E2F31",
|
|
865
|
-
success: "#5DC292",
|
|
866
|
-
warning: "#E29A2E"
|
|
867
|
-
},
|
|
868
|
-
icon: {
|
|
869
|
-
error: "#FE6E76",
|
|
870
|
-
info: "#FAFAFA",
|
|
871
|
-
success: "#5DC292",
|
|
872
|
-
warning: "#FFB84E"
|
|
873
|
-
}
|
|
874
|
-
},
|
|
875
|
-
highlightInactive: {
|
|
876
|
-
"default": "#78797A"
|
|
877
|
-
},
|
|
878
|
-
autofill: "#5D5881",
|
|
879
|
-
background: {
|
|
880
|
-
"default": "#1D1E1F",
|
|
881
|
-
paper: "#2E2F31"
|
|
882
|
-
},
|
|
883
|
-
checkbox: {
|
|
884
|
-
"default": "#FFFFFF"
|
|
885
|
-
},
|
|
886
|
-
divider: "#252728",
|
|
887
|
-
error: "#C22D74",
|
|
888
|
-
font: {
|
|
889
|
-
button: "#202124",
|
|
890
|
-
"default": "#FCFCFC",
|
|
891
|
-
gray: "#9E9D9D",
|
|
892
|
-
textButton: "#FFFFFF",
|
|
893
|
-
textDisabled: "#FCFCFC"
|
|
894
|
-
},
|
|
895
|
-
gray: {
|
|
896
|
-
"default": "#202124",
|
|
897
|
-
disabled: "rgba(32, 33, 36, 0.6)"
|
|
898
|
-
},
|
|
899
|
-
input: {
|
|
900
|
-
border: "#9d9d9d",
|
|
901
|
-
"default": "#25262A",
|
|
902
|
-
disabled: "#393939",
|
|
903
|
-
disabledBackground: "#292A2D",
|
|
904
|
-
disabledText: "#9D9D9D",
|
|
905
|
-
error: "#8C2054",
|
|
906
|
-
text: "#FCFCFC",
|
|
907
|
-
textHover: "#616161"
|
|
908
|
-
},
|
|
909
|
-
paperBorder: "#252728",
|
|
910
|
-
primary: "#13BEBB",
|
|
911
|
-
secondary: "#21125E",
|
|
912
|
-
success: "#5DC292",
|
|
913
|
-
theme: "dark"
|
|
914
|
-
};
|
|
915
|
-
var light = {
|
|
916
|
-
alert: {
|
|
917
|
-
paper: {
|
|
918
|
-
error: "#FFD6D9",
|
|
919
|
-
info: "#FFFFFF",
|
|
920
|
-
success: "#DFF3E9",
|
|
921
|
-
warning: "#FFF4E4"
|
|
922
|
-
},
|
|
923
|
-
icon: {
|
|
924
|
-
error: "#FE6E76",
|
|
925
|
-
info: "#28234A",
|
|
926
|
-
success: "#5DC292",
|
|
927
|
-
warning: "#FFB84E"
|
|
928
|
-
}
|
|
929
|
-
},
|
|
930
|
-
highlightInactive: {
|
|
931
|
-
"default": "#C8C8C8"
|
|
932
|
-
},
|
|
933
|
-
autofill: "#f4f6c5",
|
|
934
|
-
background: {
|
|
935
|
-
"default": "#EFF5F8",
|
|
936
|
-
paper: "#FFFFFF"
|
|
937
|
-
},
|
|
938
|
-
checkbox: {
|
|
939
|
-
"default": "#616161"
|
|
940
|
-
},
|
|
941
|
-
divider: "#EAEAEA",
|
|
942
|
-
error: "#FE6D76",
|
|
943
|
-
font: {
|
|
944
|
-
button: "#FFFFFF",
|
|
945
|
-
"default": "#3D3D3D",
|
|
946
|
-
gray: "#616161",
|
|
947
|
-
textButton: "#06847B",
|
|
948
|
-
textDisabled: "#616161"
|
|
949
|
-
},
|
|
950
|
-
gray: {
|
|
951
|
-
"default": "#C8C8C8",
|
|
952
|
-
disabled: "rgba(216, 216, 216, 0.3)"
|
|
953
|
-
},
|
|
954
|
-
input: {
|
|
955
|
-
border: "#BDBDBD",
|
|
956
|
-
"default": "#FFFFFF",
|
|
957
|
-
disabled: "#EAEAEA",
|
|
958
|
-
disabledBackground: "#F4F4F4",
|
|
959
|
-
disabledText: "#9D9D9D",
|
|
960
|
-
error: "#8C2054",
|
|
961
|
-
text: "#3D3D3D",
|
|
962
|
-
textHover: "#616161"
|
|
963
|
-
},
|
|
964
|
-
paperBorder: "#EAEAEA",
|
|
965
|
-
primary: "#06847B",
|
|
966
|
-
secondary: "#21125E",
|
|
967
|
-
success: "#5DC292",
|
|
968
|
-
theme: "light"
|
|
969
|
-
};
|
|
970
|
-
|
|
971
|
-
function changeColorMeta(color) {
|
|
972
|
-
var themeColorTag = document.createElement("meta");
|
|
973
|
-
themeColorTag.setAttribute("content", color);
|
|
974
|
-
themeColorTag.setAttribute("name", "theme-color");
|
|
975
|
-
var existingColorTag = document.head.querySelector("meta[name=\"theme-color\"]");
|
|
976
|
-
|
|
977
|
-
if (existingColorTag) {
|
|
978
|
-
existingColorTag.remove();
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
document.head.appendChild(themeColorTag);
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
var ThemeProvider = function ThemeProvider(_ref) {
|
|
985
|
-
var children = _ref.children,
|
|
986
|
-
_ref$defaultTheme = _ref.defaultTheme,
|
|
987
|
-
defaultTheme = _ref$defaultTheme === void 0 ? "light" : _ref$defaultTheme,
|
|
988
|
-
_ref$palettes = _ref.palettes,
|
|
989
|
-
palettes = _ref$palettes === void 0 ? {} : _ref$palettes,
|
|
990
|
-
_ref$overrides = _ref.overrides,
|
|
991
|
-
overrides = _ref$overrides === void 0 ? {} : _ref$overrides;
|
|
992
|
-
|
|
993
|
-
var _useLocalStorage = useLocalStorage(localStorageKeys.theme, defaultTheme),
|
|
994
|
-
themeTypeName = _useLocalStorage.value,
|
|
995
|
-
setThemeType = _useLocalStorage.setValue;
|
|
996
|
-
|
|
997
|
-
var themeType = themeTypeName;
|
|
998
|
-
|
|
999
|
-
var themes = _extends({
|
|
1000
|
-
light: light,
|
|
1001
|
-
dark: dark
|
|
1002
|
-
}, palettes);
|
|
1003
|
-
|
|
1004
|
-
var theme = merge(createTheme(themes[themeType]), overrides);
|
|
1005
|
-
|
|
1006
|
-
var sendThemeToExtension = function sendThemeToExtension() {
|
|
1007
|
-
return sendMessageToExtension({
|
|
1008
|
-
theme: themeType,
|
|
1009
|
-
type: ExtensionMessageType.THEME
|
|
1010
|
-
}, "*");
|
|
1011
|
-
};
|
|
1012
|
-
|
|
1013
|
-
useEffect(function () {
|
|
1014
|
-
sendThemeToExtension();
|
|
1015
|
-
changeColorMeta(theme.palette.background["default"]); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1016
|
-
}, [themeType]);
|
|
1017
|
-
return React.createElement(ThemeContext.Provider, {
|
|
1018
|
-
value: {
|
|
1019
|
-
themeType: themeType,
|
|
1020
|
-
sendThemeToExtension: sendThemeToExtension,
|
|
1021
|
-
setTheme: setThemeType
|
|
1022
|
-
}
|
|
1023
|
-
}, React.createElement(MuiThemeProvider, {
|
|
1024
|
-
theme: theme
|
|
1025
|
-
}, React.createElement(ActionBarProvider, null, React.createElement(BacklinkProvider, null, React.createElement(Baseline, null), children))));
|
|
1026
|
-
};
|
|
1027
|
-
|
|
1028
|
-
var CompleteIcon = function CompleteIcon(props) {
|
|
1029
|
-
return React.createElement("svg", Object.assign({
|
|
1030
|
-
width: "40",
|
|
1031
|
-
height: "40",
|
|
1032
|
-
viewBox: "0 0 40 40",
|
|
1033
|
-
fill: "none",
|
|
1034
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1035
|
-
}, props), React.createElement("circle", {
|
|
1036
|
-
cx: "20",
|
|
1037
|
-
cy: "20",
|
|
1038
|
-
r: "20",
|
|
1039
|
-
fill: "white"
|
|
1040
|
-
}), React.createElement("circle", {
|
|
1041
|
-
cx: "20",
|
|
1042
|
-
cy: "20",
|
|
1043
|
-
r: "14",
|
|
1044
|
-
stroke: "#5DC292",
|
|
1045
|
-
strokeWidth: "4"
|
|
1046
|
-
}), React.createElement("path", {
|
|
1047
|
-
fillRule: "evenodd",
|
|
1048
|
-
clipRule: "evenodd",
|
|
1049
|
-
d: "M28.7678 13.7678C29.3536 14.3536 29.3536 15.3033 28.7678 15.8891L17.4142 27.2426L12.0607 21.8891C11.4749 21.3033 11.4749 20.3536 12.0607 19.7678L12.7678 19.0607C13.3536 18.4749 14.3033 18.4749 14.8891 19.0607L17.4142 21.5858L25.9393 13.0607C26.5251 12.4749 27.4749 12.4749 28.0607 13.0607L28.7678 13.7678Z",
|
|
1050
|
-
fill: "#5DC292"
|
|
1051
|
-
}));
|
|
1052
|
-
};
|
|
1053
|
-
CompleteIcon.displayName = "CompleteIcon";
|
|
1054
|
-
|
|
1055
|
-
var InfoIcon = function InfoIcon(props) {
|
|
1056
|
-
return React.createElement("svg", Object.assign({
|
|
1057
|
-
width: "40",
|
|
1058
|
-
height: "40",
|
|
1059
|
-
viewBox: "0 0 40 40",
|
|
1060
|
-
fill: "none",
|
|
1061
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1062
|
-
}, props), React.createElement("circle", {
|
|
1063
|
-
cx: "20",
|
|
1064
|
-
cy: "20",
|
|
1065
|
-
r: "20",
|
|
1066
|
-
fill: "white"
|
|
1067
|
-
}), React.createElement("circle", {
|
|
1068
|
-
cx: "20",
|
|
1069
|
-
cy: "20",
|
|
1070
|
-
r: "14",
|
|
1071
|
-
stroke: "#28234A",
|
|
1072
|
-
strokeWidth: "4"
|
|
1073
|
-
}), React.createElement("path", {
|
|
1074
|
-
fillRule: "evenodd",
|
|
1075
|
-
clipRule: "evenodd",
|
|
1076
|
-
d: "M19.5 11C18.6716 11 18 11.6716 18 12.5V20.5C18 21.3284 18.6716 22 19.5 22H20.5C21.3284 22 22 21.3284 22 20.5V12.5C22 11.6716 21.3284 11 20.5 11H19.5ZM19.5 25C18.6716 25 18 25.6716 18 26.5V27.5C18 28.3284 18.6716 29 19.5 29H20.5C21.3284 29 22 28.3284 22 27.5V26.5C22 25.6716 21.3284 25 20.5 25H19.5Z",
|
|
1077
|
-
fill: "#28234A"
|
|
1078
|
-
}));
|
|
1079
|
-
};
|
|
1080
|
-
InfoIcon.displayName = "InfoIcon";
|
|
1081
|
-
|
|
1082
|
-
var NotAllowedIcon = function NotAllowedIcon(props) {
|
|
1083
|
-
return React.createElement("svg", Object.assign({
|
|
1084
|
-
width: "40",
|
|
1085
|
-
height: "40",
|
|
1086
|
-
viewBox: "0 0 40 40",
|
|
1087
|
-
fill: "none",
|
|
1088
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1089
|
-
}, props), React.createElement("circle", {
|
|
1090
|
-
cx: "20",
|
|
1091
|
-
cy: "20",
|
|
1092
|
-
r: "16",
|
|
1093
|
-
fill: "#F5FAFB"
|
|
1094
|
-
}), React.createElement("circle", {
|
|
1095
|
-
cx: "20",
|
|
1096
|
-
cy: "20",
|
|
1097
|
-
r: "20",
|
|
1098
|
-
fill: "white"
|
|
1099
|
-
}), React.createElement("path", {
|
|
1100
|
-
fillRule: "evenodd",
|
|
1101
|
-
clipRule: "evenodd",
|
|
1102
|
-
d: "M26.9531 29.7815C24.9914 31.1784 22.5917 32 20 32C13.3726 32 8 26.6274 8 20C8 17.4083 8.82158 15.0086 10.2185 13.0469L26.9531 29.7815ZM29.7815 26.9531L13.0469 10.2185C15.0086 8.82158 17.4083 8 20 8C26.6274 8 32 13.3726 32 20C32 22.5917 31.1784 24.9914 29.7815 26.9531ZM36 20C36 28.8366 28.8366 36 20 36C11.1634 36 4 28.8366 4 20C4 11.1634 11.1634 4 20 4C28.8366 4 36 11.1634 36 20Z",
|
|
1103
|
-
fill: "#FE6E76"
|
|
1104
|
-
}));
|
|
1105
|
-
};
|
|
1106
|
-
NotAllowedIcon.displayName = "NotAllowedIcon";
|
|
1107
|
-
|
|
1108
|
-
var NotAllowedInvertedIcon = function NotAllowedInvertedIcon(props) {
|
|
1109
|
-
return React.createElement("svg", Object.assign({
|
|
1110
|
-
width: "40",
|
|
1111
|
-
height: "40",
|
|
1112
|
-
viewBox: "0 0 40 40",
|
|
1113
|
-
fill: "none",
|
|
1114
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1115
|
-
}, props), React.createElement("circle", {
|
|
1116
|
-
cx: "20",
|
|
1117
|
-
cy: "20",
|
|
1118
|
-
r: "16",
|
|
1119
|
-
fill: "#F5FAFB"
|
|
1120
|
-
}), React.createElement("circle", {
|
|
1121
|
-
cx: "20",
|
|
1122
|
-
cy: "20",
|
|
1123
|
-
r: "20",
|
|
1124
|
-
fill: "#FE6E76"
|
|
1125
|
-
}), React.createElement("path", {
|
|
1126
|
-
fillRule: "evenodd",
|
|
1127
|
-
clipRule: "evenodd",
|
|
1128
|
-
d: "M26.9531 29.7815C24.9914 31.1784 22.5917 32 20 32C13.3726 32 8 26.6274 8 20C8 17.4083 8.82158 15.0086 10.2185 13.0469L26.9531 29.7815ZM29.7815 26.9531L13.0469 10.2185C15.0086 8.82158 17.4083 8 20 8C26.6274 8 32 13.3726 32 20C32 22.5917 31.1784 24.9914 29.7815 26.9531ZM36 20C36 28.8366 28.8366 36 20 36C11.1634 36 4 28.8366 4 20C4 11.1634 11.1634 4 20 4C28.8366 4 36 11.1634 36 20Z",
|
|
1129
|
-
fill: "white"
|
|
1130
|
-
}));
|
|
1131
|
-
};
|
|
1132
|
-
NotAllowedInvertedIcon.displayName = "NotAllowedInvertedIcon";
|
|
1133
|
-
|
|
1134
|
-
var WarningIcon = function WarningIcon(props) {
|
|
1135
|
-
return React.createElement("svg", Object.assign({
|
|
1136
|
-
width: "40",
|
|
1137
|
-
height: "40",
|
|
1138
|
-
viewBox: "0 0 40 40",
|
|
1139
|
-
fill: "none",
|
|
1140
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1141
|
-
}, props), React.createElement("circle", {
|
|
1142
|
-
cx: "20",
|
|
1143
|
-
cy: "20",
|
|
1144
|
-
r: "20",
|
|
1145
|
-
fill: "white"
|
|
1146
|
-
}), React.createElement("circle", {
|
|
1147
|
-
cx: "20",
|
|
1148
|
-
cy: "20",
|
|
1149
|
-
r: "14",
|
|
1150
|
-
stroke: "#FFB84E",
|
|
1151
|
-
strokeWidth: "4"
|
|
1152
|
-
}), React.createElement("path", {
|
|
1153
|
-
fillRule: "evenodd",
|
|
1154
|
-
clipRule: "evenodd",
|
|
1155
|
-
d: "M19.5 11C18.6716 11 18 11.6716 18 12.5V20.5C18 21.3284 18.6716 22 19.5 22H20.5C21.3284 22 22 21.3284 22 20.5V12.5C22 11.6716 21.3284 11 20.5 11H19.5ZM19.5 25C18.6716 25 18 25.6716 18 26.5V27.5C18 28.3284 18.6716 29 19.5 29H20.5C21.3284 29 22 28.3284 22 27.5V26.5C22 25.6716 21.3284 25 20.5 25H19.5Z",
|
|
1156
|
-
fill: "#FFB84E"
|
|
1157
|
-
}));
|
|
1158
|
-
};
|
|
1159
|
-
WarningIcon.displayName = "WarningIcon";
|
|
1160
|
-
|
|
1161
|
-
var ArrowDropdownIcon = /*#__PURE__*/createSvgIcon( /*#__PURE__*/React.createElement("g", {
|
|
1162
|
-
style: {
|
|
1163
|
-
fillRule: "evenodd"
|
|
1164
|
-
}
|
|
1165
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
1166
|
-
d: "M7 10l5 5 5-5z"
|
|
1167
|
-
})), "ArrowDropdownIcon");
|
|
1168
|
-
|
|
1169
|
-
var CheckboxIcon = /*#__PURE__*/createSvgIcon( /*#__PURE__*/React.createElement("rect", {
|
|
1170
|
-
x: "5",
|
|
1171
|
-
y: "5",
|
|
1172
|
-
width: "14",
|
|
1173
|
-
height: "14",
|
|
1174
|
-
stroke: "currentColor",
|
|
1175
|
-
fill: "none"
|
|
1176
|
-
}), "CheckboxIcon");
|
|
1177
|
-
|
|
1178
|
-
var CheckboxCheckedIcon = /*#__PURE__*/createSvgIcon( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("rect", {
|
|
1179
|
-
x: "5",
|
|
1180
|
-
y: "5",
|
|
1181
|
-
width: "14",
|
|
1182
|
-
height: "14",
|
|
1183
|
-
fill: "currentColor"
|
|
1184
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
1185
|
-
fillRule: "evenodd",
|
|
1186
|
-
clipRule: "evenodd",
|
|
1187
|
-
d: "M 16.7527 9.33783 L 10.86618 15.7595 L 8 12.32006 L 8.76822 11.67988 L 10.90204 14.24046 L 16.0155 8.66211 L 16.7527 9.33783 Z",
|
|
1188
|
-
fill: "white"
|
|
1189
|
-
})), "CheckboxCheckedIcon");
|
|
1190
|
-
|
|
1191
|
-
var CheckboxIndeterminateIcon = /*#__PURE__*/createSvgIcon( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("rect", {
|
|
1192
|
-
x: "5",
|
|
1193
|
-
y: "5",
|
|
1194
|
-
width: "14",
|
|
1195
|
-
height: "14",
|
|
1196
|
-
stroke: "currentColor",
|
|
1197
|
-
fill: "none"
|
|
1198
|
-
}), /*#__PURE__*/React.createElement("rect", {
|
|
1199
|
-
x: "8",
|
|
1200
|
-
y: "11",
|
|
1201
|
-
width: "8",
|
|
1202
|
-
height: "2",
|
|
1203
|
-
fill: "currentColor"
|
|
1204
|
-
})), "CheckboxIndeterminateIcon");
|
|
1205
|
-
|
|
1206
|
-
var SearchIcon = /*#__PURE__*/createSvgIcon( /*#__PURE__*/React.createElement("path", {
|
|
1207
|
-
fillRule: "evenodd",
|
|
1208
|
-
clipRule: "evenodd",
|
|
1209
|
-
d: "M17 10.5C17 14.0899 14.0899 17 10.5 17C6.91015 17 4 14.0899 4 10.5C4 6.91015 6.91015 4 10.5 4C14.0899 4 17 6.91015 17 10.5ZM15.7618 17.176C14.3145 18.3183 12.4869 19 10.5 19C5.80558 19 2 15.1944 2 10.5C2 5.80558 5.80558 2 10.5 2C15.1944 2 19 5.80558 19 10.5C19 12.4869 18.3183 14.3145 17.176 15.7618L21.7071 20.2929C22.0976 20.6834 22.0976 21.3166 21.7071 21.7071C21.3166 22.0976 20.6834 22.0976 20.2929 21.7071L15.7618 17.176Z",
|
|
1210
|
-
fill: "currentColor"
|
|
1211
|
-
}), "SearchIcon");
|
|
1212
|
-
|
|
1213
|
-
var EditIcon = /*#__PURE__*/createSvgIcon( /*#__PURE__*/React.createElement("path", {
|
|
1214
|
-
fillRule: "evenodd",
|
|
1215
|
-
clipRule: "evenodd",
|
|
1216
|
-
d: "M20.0445 2.90731C18.8236 1.69756 16.8544 1.69756 15.6336 2.90731L14.7077 3.82479L7.00549 11.4569C6.63843 11.8206 6.41956 12.3074 6.39126 12.8231L6.24246 15.535C6.17315 16.7984 7.23704 17.8317 8.4994 17.7272L11.1564 17.5073C11.646 17.4668 12.1055 17.2551 12.4543 16.9096L21.0739 8.36838C22.3086 7.14491 22.3086 5.15086 21.0739 3.92738L20.0445 2.90731ZM8.47578 12.9372L15.4428 6.03358L17.9544 8.52227L10.984 15.4292L8.32698 15.6492L8.47578 12.9372ZM16.9249 4.56496L19.4365 7.05365L19.6036 6.88805C20.0152 6.48022 20.0152 5.81554 19.6036 5.40772L18.5742 4.38765C18.1672 3.9844 17.5108 3.9844 17.1039 4.38765L16.9249 4.56496ZM5.13147 3.23318C3.40201 3.23318 2 4.63355 2 6.36099V18.8722C2 20.5997 3.40201 22 5.13147 22H17.6573C19.3868 22 20.7888 20.5997 20.7888 18.8722V14.2848C20.7888 13.709 20.3215 13.2422 19.745 13.2422C19.1685 13.2422 18.7012 13.709 18.7012 14.2848V18.8722C18.7012 19.4481 18.2338 19.9148 17.6573 19.9148H5.13147C4.55498 19.9148 4.08765 19.4481 4.08765 18.8722V6.36099C4.08765 5.78518 4.55498 5.31839 5.13147 5.31839H9.72429C10.3008 5.31839 10.7681 4.8516 10.7681 4.27578C10.7681 3.69997 10.3008 3.23318 9.72429 3.23318H5.13147Z",
|
|
1217
|
-
fill: "currentColor"
|
|
1218
|
-
}), "EditIcon");
|
|
1219
|
-
|
|
1220
|
-
// It's only optimized for esm, cjs will remain fat blob
|
|
1221
|
-
|
|
1222
|
-
function getPosition() {
|
|
1223
|
-
return {
|
|
1224
|
-
x: window.pageXOffset,
|
|
1225
|
-
y: window.pageYOffset
|
|
1226
|
-
};
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
function useWindowScroll() {
|
|
1230
|
-
var _useState = useState(getPosition),
|
|
1231
|
-
scroll = _useState[0],
|
|
1232
|
-
setScroll = _useState[1];
|
|
1233
|
-
|
|
1234
|
-
useEffect(function () {
|
|
1235
|
-
var handleScroll = throttle(function () {
|
|
1236
|
-
return setScroll(getPosition());
|
|
1237
|
-
}, 100);
|
|
1238
|
-
window.addEventListener("scroll", handleScroll);
|
|
1239
|
-
return function () {
|
|
1240
|
-
return window.removeEventListener("scroll", handleScroll);
|
|
1241
|
-
};
|
|
1242
|
-
}, []);
|
|
1243
|
-
return scroll;
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
var useStyles$1 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1247
|
-
var _content;
|
|
1248
|
-
|
|
1249
|
-
return {
|
|
1250
|
-
content: (_content = {
|
|
1251
|
-
"&:last-child": {
|
|
1252
|
-
paddingBottom: theme.spacing(2)
|
|
1253
|
-
},
|
|
1254
|
-
display: "flex",
|
|
1255
|
-
paddingBottom: theme.spacing(2),
|
|
1256
|
-
paddingTop: theme.spacing(2)
|
|
1257
|
-
}, _content[theme.breakpoints.down("sm")] = {
|
|
1258
|
-
marginTop: theme.spacing(1)
|
|
1259
|
-
}, _content),
|
|
1260
|
-
paper: {
|
|
1261
|
-
borderBottomLeftRadius: 0,
|
|
1262
|
-
borderBottomRightRadius: 0
|
|
1263
|
-
},
|
|
1264
|
-
root: {
|
|
1265
|
-
height: 70
|
|
1266
|
-
}
|
|
1267
|
-
};
|
|
1268
|
-
}, {
|
|
1269
|
-
name: "Savebar"
|
|
1270
|
-
});
|
|
1271
|
-
|
|
1272
|
-
var ActionBar = function ActionBar(_ref) {
|
|
1273
|
-
var disabled = _ref.disabled,
|
|
1274
|
-
children = _ref.children,
|
|
1275
|
-
state = _ref.state,
|
|
1276
|
-
rest = _objectWithoutPropertiesLoose(_ref, ["disabled", "children", "state"]);
|
|
1277
|
-
|
|
1278
|
-
var classes = useStyles$1();
|
|
1279
|
-
|
|
1280
|
-
var _useActionBar = useActionBar(),
|
|
1281
|
-
anchor = _useActionBar.anchor,
|
|
1282
|
-
docked = _useActionBar.docked,
|
|
1283
|
-
setDocked = _useActionBar.setDocked;
|
|
1284
|
-
|
|
1285
|
-
var scrollPosition = useWindowScroll();
|
|
1286
|
-
React.useEffect(function () {
|
|
1287
|
-
if (!disabled && state !== "loading") {
|
|
1288
|
-
setDocked(false);
|
|
1289
|
-
}
|
|
1290
|
-
}, [disabled, state, setDocked]);
|
|
1291
|
-
React.useEffect(function () {
|
|
1292
|
-
return function () {
|
|
1293
|
-
return setDocked(true);
|
|
1294
|
-
};
|
|
1295
|
-
}, [setDocked]);
|
|
1296
|
-
var scrolledToBottom = scrollPosition.y + window.innerHeight >= document.body.scrollHeight;
|
|
1297
|
-
|
|
1298
|
-
if (!anchor.current) {
|
|
1299
|
-
return null;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
return React.createElement(Portal, {
|
|
1303
|
-
container: anchor.current
|
|
1304
|
-
}, React.createElement("div", Object.assign({
|
|
1305
|
-
className: classes.root
|
|
1306
|
-
}, rest), React.createElement(Container, {
|
|
1307
|
-
maxWidth: "lg"
|
|
1308
|
-
}, React.createElement(Card, {
|
|
1309
|
-
className: classes.paper,
|
|
1310
|
-
elevation: !(docked || scrolledToBottom) ? 16 : 0
|
|
1311
|
-
}, React.createElement(CardContent, {
|
|
1312
|
-
className: classes.content
|
|
1313
|
-
}, children)))));
|
|
1314
|
-
};
|
|
1315
|
-
ActionBar.displayName = "ActionBar";
|
|
1316
|
-
|
|
1317
|
-
var useStyles$2 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1318
|
-
return {
|
|
1319
|
-
error: {
|
|
1320
|
-
"&:hover": {
|
|
1321
|
-
backgroundColor: theme.palette.error.main
|
|
1322
|
-
},
|
|
1323
|
-
backgroundColor: theme.palette.error.main,
|
|
1324
|
-
color: theme.palette.error.contrastText
|
|
1325
|
-
},
|
|
1326
|
-
icon: {
|
|
1327
|
-
marginLeft: "0 !important",
|
|
1328
|
-
position: "absolute",
|
|
1329
|
-
transitionDuration: theme.transitions.duration.standard + "ms"
|
|
1330
|
-
},
|
|
1331
|
-
invisible: {
|
|
1332
|
-
opacity: 0
|
|
1333
|
-
},
|
|
1334
|
-
label: {
|
|
1335
|
-
alignItems: "center",
|
|
1336
|
-
display: "flex",
|
|
1337
|
-
transitionDuration: theme.transitions.duration.standard + "ms"
|
|
1338
|
-
},
|
|
1339
|
-
progress: {
|
|
1340
|
-
"& svg": {
|
|
1341
|
-
color: theme.palette.common.white,
|
|
1342
|
-
margin: 0
|
|
1343
|
-
},
|
|
1344
|
-
position: "absolute",
|
|
1345
|
-
transitionDuration: theme.transitions.duration.standard + "ms"
|
|
1346
|
-
},
|
|
1347
|
-
success: {
|
|
1348
|
-
"&:hover": {
|
|
1349
|
-
backgroundColor: theme.palette.primary.main
|
|
1350
|
-
},
|
|
1351
|
-
backgroundColor: theme.palette.primary.main,
|
|
1352
|
-
color: theme.palette.primary.contrastText
|
|
1353
|
-
}
|
|
1354
|
-
};
|
|
1355
|
-
}, {
|
|
1356
|
-
name: "ConfirmButton"
|
|
1357
|
-
});
|
|
1358
|
-
|
|
1359
|
-
var DEFAULT_NOTIFICATION_SHOW_TIME = 3000;
|
|
1360
|
-
var ConfirmButton = function ConfirmButton(_ref) {
|
|
1361
|
-
var _clsx, _clsx2, _clsx3, _clsx4;
|
|
1362
|
-
|
|
1363
|
-
var children = _ref.children,
|
|
1364
|
-
className = _ref.className,
|
|
1365
|
-
disabled = _ref.disabled,
|
|
1366
|
-
labels = _ref.labels,
|
|
1367
|
-
noTransition = _ref.noTransition,
|
|
1368
|
-
transitionState = _ref.transitionState,
|
|
1369
|
-
onClick = _ref.onClick,
|
|
1370
|
-
onTransitionToDefault = _ref.onTransitionToDefault,
|
|
1371
|
-
props = _objectWithoutPropertiesLoose(_ref, ["children", "className", "disabled", "labels", "noTransition", "transitionState", "onClick", "onTransitionToDefault"]);
|
|
1372
|
-
|
|
1373
|
-
var classes = useStyles$2();
|
|
1374
|
-
|
|
1375
|
-
var _React$useState = React.useState(false),
|
|
1376
|
-
displayCompletedActionState = _React$useState[0],
|
|
1377
|
-
setDisplayCompletedActionState = _React$useState[1];
|
|
1378
|
-
|
|
1379
|
-
var timeout = React.useRef();
|
|
1380
|
-
React.useEffect(function () {
|
|
1381
|
-
if (!noTransition && transitionState === "loading") {
|
|
1382
|
-
setDisplayCompletedActionState(true);
|
|
1383
|
-
}
|
|
1384
|
-
}, [transitionState, noTransition]);
|
|
1385
|
-
React.useEffect(function () {
|
|
1386
|
-
if (!noTransition && ["error", "success"].includes(transitionState)) {
|
|
1387
|
-
timeout.current = setTimeout(function () {
|
|
1388
|
-
setDisplayCompletedActionState(false);
|
|
1389
|
-
|
|
1390
|
-
if (onTransitionToDefault) {
|
|
1391
|
-
onTransitionToDefault();
|
|
1392
|
-
}
|
|
1393
|
-
}, DEFAULT_NOTIFICATION_SHOW_TIME);
|
|
1394
|
-
} else if (transitionState === "loading") {
|
|
1395
|
-
clearTimeout(timeout.current);
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
return function () {
|
|
1399
|
-
if (timeout.current) {
|
|
1400
|
-
clearTimeout(timeout.current);
|
|
1401
|
-
}
|
|
1402
|
-
};
|
|
1403
|
-
}, [noTransition, transitionState, onTransitionToDefault]);
|
|
1404
|
-
var isCompleted = noTransition ? transitionState !== "default" : displayCompletedActionState;
|
|
1405
|
-
return React.createElement(Button, Object.assign({
|
|
1406
|
-
variant: "contained",
|
|
1407
|
-
onClick: transitionState === "loading" ? undefined : onClick,
|
|
1408
|
-
color: "primary",
|
|
1409
|
-
className: clsx(className, (_clsx = {}, _clsx[classes.error] = transitionState === "error" && isCompleted, _clsx[classes.success] = transitionState === "success" && isCompleted, _clsx)),
|
|
1410
|
-
disabled: !isCompleted && disabled,
|
|
1411
|
-
"data-test-state": isCompleted ? transitionState : "default"
|
|
1412
|
-
}, props), React.createElement(CircularProgress, {
|
|
1413
|
-
size: 24,
|
|
1414
|
-
color: "inherit",
|
|
1415
|
-
className: clsx((_clsx2 = {}, _clsx2[classes.progress] = true, _clsx2[classes.invisible] = transitionState !== "loading", _clsx2))
|
|
1416
|
-
}), React.createElement(CheckIcon, {
|
|
1417
|
-
className: clsx((_clsx3 = {}, _clsx3[classes.icon] = true, _clsx3[classes.invisible] = !(transitionState === "success" && isCompleted), _clsx3))
|
|
1418
|
-
}), React.createElement("span", {
|
|
1419
|
-
className: clsx((_clsx4 = {}, _clsx4[classes.label] = true, _clsx4[classes.invisible] = (transitionState === "loading" || transitionState === "success") && isCompleted, _clsx4))
|
|
1420
|
-
}, transitionState === "error" && isCompleted ? labels.error : children || labels.confirm));
|
|
1421
|
-
};
|
|
1422
|
-
ConfirmButton.displayName = "ConfirmButton";
|
|
1423
|
-
|
|
1424
|
-
var ButtonTooltipDecorator = function ButtonTooltipDecorator(_ref) {
|
|
1425
|
-
var tooltip = _ref.tooltip,
|
|
1426
|
-
children = _ref.children;
|
|
1427
|
-
|
|
1428
|
-
if (tooltip) {
|
|
1429
|
-
return React.createElement(Tooltip$1, {
|
|
1430
|
-
title: tooltip,
|
|
1431
|
-
placement: "top"
|
|
1432
|
-
}, React.createElement("span", null, children));
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
return React.createElement(React.Fragment, null, children);
|
|
1436
|
-
};
|
|
1437
|
-
ButtonTooltipDecorator.displayName = "ButtonTooltipDecorator";
|
|
1438
|
-
|
|
1439
|
-
var useStyles$3 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1440
|
-
return {
|
|
1441
|
-
button: {
|
|
1442
|
-
marginRight: theme.spacing(1)
|
|
1443
|
-
},
|
|
1444
|
-
cancelButton: {
|
|
1445
|
-
marginRight: theme.spacing(2)
|
|
1446
|
-
},
|
|
1447
|
-
deleteButton: {
|
|
1448
|
-
"&:hover": {
|
|
1449
|
-
backgroundColor: theme.palette.error.dark
|
|
1450
|
-
},
|
|
1451
|
-
backgroundColor: theme.palette.error.main,
|
|
1452
|
-
color: theme.palette.error.contrastText
|
|
1453
|
-
},
|
|
1454
|
-
spacer: {
|
|
1455
|
-
flex: "1"
|
|
1456
|
-
}
|
|
1457
|
-
};
|
|
1458
|
-
}, {
|
|
1459
|
-
name: "Savebar"
|
|
1460
|
-
});
|
|
1461
|
-
|
|
1462
|
-
var Savebar = function Savebar(_ref) {
|
|
1463
|
-
var disabled = _ref.disabled,
|
|
1464
|
-
labels = _ref.labels,
|
|
1465
|
-
tooltips = _ref.tooltips,
|
|
1466
|
-
state = _ref.state,
|
|
1467
|
-
onCancel = _ref.onCancel,
|
|
1468
|
-
onDelete = _ref.onDelete,
|
|
1469
|
-
onSubmit = _ref.onSubmit;
|
|
1470
|
-
var classes = useStyles$3();
|
|
1471
|
-
|
|
1472
|
-
var _useActionBar = useActionBar(),
|
|
1473
|
-
setDocked = _useActionBar.setDocked;
|
|
1474
|
-
|
|
1475
|
-
return React.createElement(ActionBar, {
|
|
1476
|
-
state: state,
|
|
1477
|
-
disabled: disabled
|
|
1478
|
-
}, !!onDelete && React.createElement(ButtonTooltipDecorator, {
|
|
1479
|
-
tooltip: tooltips == null ? void 0 : tooltips["delete"]
|
|
1480
|
-
}, React.createElement(Button, {
|
|
1481
|
-
variant: "contained",
|
|
1482
|
-
onClick: onDelete,
|
|
1483
|
-
className: classes.deleteButton,
|
|
1484
|
-
"data-test": "button-bar-delete"
|
|
1485
|
-
}, labels["delete"])), React.createElement("div", {
|
|
1486
|
-
className: classes.spacer
|
|
1487
|
-
}), React.createElement(ButtonTooltipDecorator, {
|
|
1488
|
-
tooltip: tooltips == null ? void 0 : tooltips.cancel
|
|
1489
|
-
}, React.createElement(Button, {
|
|
1490
|
-
className: classes.cancelButton,
|
|
1491
|
-
variant: "text",
|
|
1492
|
-
onClick: onCancel,
|
|
1493
|
-
"data-test": "button-bar-cancel"
|
|
1494
|
-
}, labels.cancel)), React.createElement(ButtonTooltipDecorator, {
|
|
1495
|
-
tooltip: tooltips == null ? void 0 : tooltips.confirm
|
|
1496
|
-
}, React.createElement(ConfirmButton, {
|
|
1497
|
-
disabled: disabled,
|
|
1498
|
-
labels: labels,
|
|
1499
|
-
onClick: onSubmit,
|
|
1500
|
-
transitionState: state,
|
|
1501
|
-
"data-test": "button-bar-confirm",
|
|
1502
|
-
onTransitionToDefault: function onTransitionToDefault() {
|
|
1503
|
-
return setDocked(true);
|
|
1504
|
-
}
|
|
1505
|
-
})));
|
|
1506
|
-
};
|
|
1507
|
-
Savebar.displayName = "Savebar";
|
|
1508
|
-
|
|
1509
|
-
var useStyles$4 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1510
|
-
var _root;
|
|
1511
|
-
|
|
1512
|
-
return {
|
|
1513
|
-
backArrow: {
|
|
1514
|
-
fontSize: 30
|
|
1515
|
-
},
|
|
1516
|
-
menuButton: {
|
|
1517
|
-
flex: "0 0 auto",
|
|
1518
|
-
marginLeft: theme.spacing(-2),
|
|
1519
|
-
marginRight: theme.spacing(),
|
|
1520
|
-
marginTop: theme.spacing(-2)
|
|
1521
|
-
},
|
|
1522
|
-
root: (_root = {
|
|
1523
|
-
"&:hover": {
|
|
1524
|
-
color: theme.typography.body1.color
|
|
1525
|
-
},
|
|
1526
|
-
alignItems: "center",
|
|
1527
|
-
color: theme.palette.grey[500],
|
|
1528
|
-
cursor: "pointer",
|
|
1529
|
-
display: "flex",
|
|
1530
|
-
marginTop: theme.spacing(0.5),
|
|
1531
|
-
transition: theme.transitions.duration.standard + "ms"
|
|
1532
|
-
}, _root[theme.breakpoints.down("sm")] = {
|
|
1533
|
-
margin: theme.spacing(4, 0, 0, 0)
|
|
1534
|
-
}, _root),
|
|
1535
|
-
skeleton: {
|
|
1536
|
-
width: "10rem"
|
|
1537
|
-
},
|
|
1538
|
-
title: {
|
|
1539
|
-
color: "inherit",
|
|
1540
|
-
flex: 1,
|
|
1541
|
-
marginLeft: theme.spacing(),
|
|
1542
|
-
textTransform: "uppercase"
|
|
1543
|
-
}
|
|
1544
|
-
};
|
|
1545
|
-
}, {
|
|
1546
|
-
name: "AppHeader"
|
|
1547
|
-
});
|
|
1548
|
-
|
|
1549
|
-
var Backlink = function Backlink(_ref) {
|
|
1550
|
-
var children = _ref.children,
|
|
1551
|
-
onClick = _ref.onClick;
|
|
1552
|
-
var classes = useStyles$4();
|
|
1553
|
-
var anchor = useBacklink();
|
|
1554
|
-
|
|
1555
|
-
if (!anchor.current) {
|
|
1556
|
-
return null;
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
return React.createElement(Portal, {
|
|
1560
|
-
container: anchor.current
|
|
1561
|
-
}, React.createElement("div", {
|
|
1562
|
-
className: classes.root,
|
|
1563
|
-
onClick: onClick,
|
|
1564
|
-
"data-test-id": "app-header-back-button"
|
|
1565
|
-
}, React.createElement(ArrowBackIcon, {
|
|
1566
|
-
className: classes.backArrow
|
|
1567
|
-
}), children ? React.createElement(Typography, {
|
|
1568
|
-
className: classes.title
|
|
1569
|
-
}, children) : React.createElement(Skeleton, {
|
|
1570
|
-
className: classes.skeleton
|
|
1571
|
-
})));
|
|
1572
|
-
};
|
|
1573
|
-
Backlink.displayName = "Backlink";
|
|
1574
|
-
|
|
1575
|
-
var Logo = function Logo(props) {
|
|
1576
|
-
return React.createElement("svg", Object.assign({
|
|
1577
|
-
width: "36",
|
|
1578
|
-
height: "33",
|
|
1579
|
-
viewBox: "0 0 36 33",
|
|
1580
|
-
fill: "none",
|
|
1581
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1582
|
-
}, props), React.createElement("path", {
|
|
1583
|
-
fillRule: "evenodd",
|
|
1584
|
-
clipRule: "evenodd",
|
|
1585
|
-
d: "M19.7838 0L13.4043 6.64709H29.1638L35.5433 0H19.7838Z",
|
|
1586
|
-
fill: "#8AC4EB"
|
|
1587
|
-
}), React.createElement("path", {
|
|
1588
|
-
fillRule: "evenodd",
|
|
1589
|
-
clipRule: "evenodd",
|
|
1590
|
-
d: "M6.59759 2.13062C6.4332 2.13062 6.27552 2.1958 6.15911 2.31187L0.182532 8.27133C0.00456112 8.44879 -0.0488948 8.71603 0.0471181 8.94829C0.143131 9.18056 0.369679 9.33205 0.621008 9.33205H21.3482C21.5126 9.33205 21.6703 9.26687 21.7867 9.1508L27.7632 3.19134C27.9412 3.01388 27.9947 2.74664 27.8987 2.51437C27.8026 2.28211 27.5761 2.13062 27.3248 2.13062H6.59759ZM2.12325 8.09007L6.85429 3.37259H25.8225L21.0915 8.09007H2.12325ZM23.9789 27.3629C23.9789 30.6214 22.4977 33 16.6072 33C11.4908 33 9.43754 31.599 9 28.1124L13.6451 27.4281C13.9144 29.1551 14.5539 29.5135 16.6745 29.5135C18.5933 29.5135 19.2328 29.0573 19.2328 28.0146C19.2328 26.7437 18.492 26.418 16.5735 26.0594C16.4207 26.0337 16.2653 26.0082 16.1079 25.9823C13.0752 25.4835 9.30464 24.8634 9.33654 20.6504C9.33654 17.2293 11.2216 15.0787 16.5735 15.0787C21.4542 15.0787 23.3055 16.7404 23.7097 20.0314L18.9298 20.7482C18.7614 19.2168 18.2566 18.6954 16.4389 18.6954C14.9577 18.6954 14.0489 19.0867 14.0489 20.1292C14.0489 21.5304 15.0924 21.7258 17.3814 22.1167C20.3772 22.6056 23.9789 23.3549 23.9789 27.3629Z",
|
|
1591
|
-
fill: "#28234A"
|
|
1592
|
-
}));
|
|
1593
|
-
};
|
|
1594
|
-
Logo.displayName = "Logo";
|
|
1595
|
-
|
|
1596
|
-
var LogoLight = function LogoLight(props) {
|
|
1597
|
-
return React.createElement("svg", Object.assign({
|
|
1598
|
-
width: "36",
|
|
1599
|
-
height: "33",
|
|
1600
|
-
viewBox: "0 0 36 33",
|
|
1601
|
-
fill: "none",
|
|
1602
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1603
|
-
}, props), React.createElement("path", {
|
|
1604
|
-
fillRule: "evenodd",
|
|
1605
|
-
clipRule: "evenodd",
|
|
1606
|
-
d: "M19.7838 0L13.4043 6.64709H29.1638L35.5433 0H19.7838Z",
|
|
1607
|
-
fill: "#8AC4EB"
|
|
1608
|
-
}), React.createElement("path", {
|
|
1609
|
-
fillRule: "evenodd",
|
|
1610
|
-
clipRule: "evenodd",
|
|
1611
|
-
d: "M6.59759 2.13062C6.4332 2.13062 6.27552 2.1958 6.15911 2.31187L0.182532 8.27133C0.00456112 8.44879 -0.0488948 8.71603 0.0471181 8.94829C0.143131 9.18056 0.369679 9.33205 0.621008 9.33205H21.3482C21.5126 9.33205 21.6703 9.26687 21.7867 9.1508L27.7632 3.19134C27.9412 3.01388 27.9947 2.74664 27.8987 2.51437C27.8026 2.28211 27.5761 2.13062 27.3248 2.13062H6.59759ZM2.12325 8.09007L6.85429 3.37259H25.8225L21.0915 8.09007H2.12325ZM23.9789 27.3629C23.9789 30.6214 22.4977 33 16.6072 33C11.4908 33 9.43754 31.599 9 28.1124L13.6451 27.4281C13.9144 29.1551 14.5539 29.5135 16.6745 29.5135C18.5933 29.5135 19.2328 29.0573 19.2328 28.0146C19.2328 26.7437 18.492 26.418 16.5735 26.0594C16.4207 26.0337 16.2653 26.0082 16.1079 25.9823C13.0752 25.4835 9.30464 24.8634 9.33654 20.6504C9.33654 17.2293 11.2216 15.0787 16.5735 15.0787C21.4542 15.0787 23.3055 16.7404 23.7097 20.0314L18.9298 20.7482C18.7614 19.2168 18.2566 18.6954 16.4389 18.6954C14.9577 18.6954 14.0489 19.0867 14.0489 20.1292C14.0489 21.5304 15.0924 21.7258 17.3814 22.1167C20.3772 22.6056 23.9789 23.3549 23.9789 27.3629Z",
|
|
1612
|
-
fill: "#FAFAFA"
|
|
1613
|
-
}));
|
|
1614
|
-
};
|
|
1615
|
-
LogoLight.displayName = "LogoLight";
|
|
1616
|
-
|
|
1617
|
-
var useStyles$5 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1618
|
-
return {
|
|
1619
|
-
root: {
|
|
1620
|
-
"&:hover, &:focus": {
|
|
1621
|
-
background: "#daedeb"
|
|
1622
|
-
},
|
|
1623
|
-
background: theme.palette.background.paper,
|
|
1624
|
-
borderRadius: 16,
|
|
1625
|
-
color: theme.palette.primary.main,
|
|
1626
|
-
height: 48,
|
|
1627
|
-
transition: theme.transitions.duration.shortest + "ms",
|
|
1628
|
-
width: 48
|
|
1629
|
-
}
|
|
1630
|
-
};
|
|
1631
|
-
}, {
|
|
1632
|
-
name: "ExpandButton"
|
|
1633
|
-
});
|
|
1634
|
-
var SquareButton = function SquareButton(_ref) {
|
|
1635
|
-
var className = _ref.className,
|
|
1636
|
-
rest = _objectWithoutPropertiesLoose(_ref, ["className"]);
|
|
1637
|
-
|
|
1638
|
-
var classes = useStyles$5({});
|
|
1639
|
-
return React.createElement(ButtonBase, Object.assign({
|
|
1640
|
-
className: clsx(classes.root, className)
|
|
1641
|
-
}, rest));
|
|
1642
|
-
};
|
|
1643
|
-
SquareButton.displayName = "SquareButton";
|
|
1644
|
-
|
|
1645
|
-
var useStyles$6 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1646
|
-
return {
|
|
1647
|
-
arrow: {
|
|
1648
|
-
transition: theme.transitions.duration.shortest + "ms"
|
|
1649
|
-
},
|
|
1650
|
-
shrunk: {
|
|
1651
|
-
transform: "scaleX(-1)"
|
|
1652
|
-
}
|
|
1653
|
-
};
|
|
1654
|
-
}, {
|
|
1655
|
-
name: "ExpandButton"
|
|
1656
|
-
});
|
|
1657
|
-
var ExpandButton = function ExpandButton(_ref) {
|
|
1658
|
-
var _clsx;
|
|
1659
|
-
|
|
1660
|
-
var isShrunk = _ref.isShrunk,
|
|
1661
|
-
rest = _objectWithoutPropertiesLoose(_ref, ["isShrunk"]);
|
|
1662
|
-
|
|
1663
|
-
var classes = useStyles$6({});
|
|
1664
|
-
return React.createElement(SquareButton, Object.assign({}, rest), React.createElement(ArrowBackIcon, {
|
|
1665
|
-
className: clsx(classes.arrow, (_clsx = {}, _clsx[classes.shrunk] = isShrunk, _clsx))
|
|
1666
|
-
}));
|
|
1667
|
-
};
|
|
1668
|
-
ExpandButton.displayName = "ExpandButton";
|
|
1669
|
-
|
|
1670
|
-
var menuWidth = 210;
|
|
1671
|
-
var shrunkMenuWidth = 72;
|
|
1672
|
-
var useStyles$7 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1673
|
-
return {
|
|
1674
|
-
hideLabel: {
|
|
1675
|
-
"&$label": {
|
|
1676
|
-
opacity: 0
|
|
1677
|
-
}
|
|
1678
|
-
},
|
|
1679
|
-
icon: {
|
|
1680
|
-
"& svg": {
|
|
1681
|
-
height: 24,
|
|
1682
|
-
width: 24
|
|
1683
|
-
},
|
|
1684
|
-
marginRight: theme.spacing(1.5),
|
|
1685
|
-
transition: theme.transitions.duration.shortest + "ms"
|
|
1686
|
-
},
|
|
1687
|
-
label: {
|
|
1688
|
-
cursor: "pointer",
|
|
1689
|
-
display: "block",
|
|
1690
|
-
fontSize: 16,
|
|
1691
|
-
fontWeight: "bold",
|
|
1692
|
-
opacity: 1,
|
|
1693
|
-
transition: theme.transitions.duration.shortest + "ms"
|
|
1694
|
-
},
|
|
1695
|
-
labelRoot: {
|
|
1696
|
-
position: "absolute",
|
|
1697
|
-
left: 72,
|
|
1698
|
-
width: 200,
|
|
1699
|
-
textAlign: "left",
|
|
1700
|
-
pointerEvents: "none"
|
|
1701
|
-
},
|
|
1702
|
-
menuItemBtn: {
|
|
1703
|
-
"&:focus": {
|
|
1704
|
-
color: theme.palette.primary.main,
|
|
1705
|
-
outline: 0
|
|
1706
|
-
},
|
|
1707
|
-
background: "none",
|
|
1708
|
-
border: "none",
|
|
1709
|
-
color: "inherit",
|
|
1710
|
-
cursor: "pointer",
|
|
1711
|
-
display: "inline-flex",
|
|
1712
|
-
margin: 0,
|
|
1713
|
-
padding: 0
|
|
1714
|
-
},
|
|
1715
|
-
paper: {
|
|
1716
|
-
borderRadius: 16,
|
|
1717
|
-
boxShadow: "0px 6px 30px rgba(0, 0, 0, 0.16)",
|
|
1718
|
-
cursor: "default",
|
|
1719
|
-
padding: theme.spacing(3),
|
|
1720
|
-
textAlign: "left"
|
|
1721
|
-
},
|
|
1722
|
-
popper: {
|
|
1723
|
-
marginLeft: theme.spacing(3),
|
|
1724
|
-
zIndex: 2
|
|
1725
|
-
},
|
|
1726
|
-
root: {
|
|
1727
|
-
"&:hover, &:focus": {
|
|
1728
|
-
color: theme.palette.primary.main,
|
|
1729
|
-
outline: 0
|
|
1730
|
-
},
|
|
1731
|
-
borderBottomRightRadius: 100,
|
|
1732
|
-
borderTopRightRadius: 100,
|
|
1733
|
-
color: fade(theme.palette.text.primary, 0.6),
|
|
1734
|
-
cursor: "pointer",
|
|
1735
|
-
display: "flex",
|
|
1736
|
-
height: 56,
|
|
1737
|
-
marginBottom: theme.spacing(),
|
|
1738
|
-
overflow: "hidden",
|
|
1739
|
-
padding: theme.spacing(2, 3, 2, 3.5),
|
|
1740
|
-
transition: theme.transitions.duration.shortest + "ms",
|
|
1741
|
-
width: shrunkMenuWidth
|
|
1742
|
-
},
|
|
1743
|
-
rootActive: {
|
|
1744
|
-
"&$root": {
|
|
1745
|
-
background: theme.palette.background.paper,
|
|
1746
|
-
boxShadow: "0px 6px 30px rgba(0, 0, 0, 0.16)",
|
|
1747
|
-
color: theme.palette.primary.main
|
|
1748
|
-
}
|
|
1749
|
-
},
|
|
1750
|
-
rootExpanded: {
|
|
1751
|
-
width: menuWidth
|
|
1752
|
-
},
|
|
1753
|
-
subMenuLabel: {
|
|
1754
|
-
"&$label": {
|
|
1755
|
-
"&:not(:last-child)": {
|
|
1756
|
-
marginBottom: theme.spacing(2)
|
|
1757
|
-
}
|
|
1758
|
-
},
|
|
1759
|
-
"&:hover, &:focus": {
|
|
1760
|
-
color: theme.palette.primary.main,
|
|
1761
|
-
outline: 0
|
|
1762
|
-
},
|
|
1763
|
-
background: "none",
|
|
1764
|
-
border: "none",
|
|
1765
|
-
color: fade(theme.palette.text.primary, 0.6),
|
|
1766
|
-
padding: 0,
|
|
1767
|
-
textAlign: "left",
|
|
1768
|
-
textDecoration: "none",
|
|
1769
|
-
whiteSpace: "nowrap"
|
|
1770
|
-
}
|
|
1771
|
-
};
|
|
1772
|
-
}, {
|
|
1773
|
-
name: "MenuItem"
|
|
1774
|
-
});
|
|
1775
|
-
var MenuItem = function MenuItem(_ref) {
|
|
1776
|
-
var _clsx, _clsx2;
|
|
1777
|
-
|
|
1778
|
-
var active = _ref.active,
|
|
1779
|
-
menuItem = _ref.menuItem,
|
|
1780
|
-
isMenuShrunk = _ref.isMenuShrunk,
|
|
1781
|
-
onClick = _ref.onClick;
|
|
1782
|
-
var classes = useStyles$7({});
|
|
1783
|
-
|
|
1784
|
-
var _React$useState = React.useState(false),
|
|
1785
|
-
open = _React$useState[0],
|
|
1786
|
-
setOpen = _React$useState[1];
|
|
1787
|
-
|
|
1788
|
-
var anchor = React.useRef(null);
|
|
1789
|
-
|
|
1790
|
-
var handleClick = function handleClick(event, menuItem) {
|
|
1791
|
-
event.stopPropagation();
|
|
1792
|
-
|
|
1793
|
-
if (menuItem.children) {
|
|
1794
|
-
setOpen(true);
|
|
1795
|
-
} else {
|
|
1796
|
-
onClick(menuItem.url);
|
|
1797
|
-
setOpen(false);
|
|
1798
|
-
}
|
|
1799
|
-
};
|
|
1800
|
-
|
|
1801
|
-
return React.createElement("div", {
|
|
1802
|
-
className: clsx(classes.root, (_clsx = {}, _clsx[classes.rootActive] = active, _clsx[classes.rootExpanded] = !isMenuShrunk, _clsx)),
|
|
1803
|
-
ref: anchor,
|
|
1804
|
-
onClick: function onClick(event) {
|
|
1805
|
-
return handleClick(event, menuItem);
|
|
1806
|
-
}
|
|
1807
|
-
}, React.createElement("button", {
|
|
1808
|
-
className: classes.menuItemBtn,
|
|
1809
|
-
"data-test": "menu-item-label",
|
|
1810
|
-
"data-test-id": menuItem.id
|
|
1811
|
-
}, menuItem.iconSrc && React.createElement(SVG, {
|
|
1812
|
-
className: classes.icon,
|
|
1813
|
-
src: menuItem.iconSrc
|
|
1814
|
-
}), React.createElement(Typography, {
|
|
1815
|
-
"aria-label": menuItem.ariaLabel,
|
|
1816
|
-
className: clsx(classes.label, classes.labelRoot, (_clsx2 = {}, _clsx2[classes.hideLabel] = isMenuShrunk, _clsx2)),
|
|
1817
|
-
variant: "body2"
|
|
1818
|
-
}, menuItem.label)), menuItem.children && React.createElement(Popper, {
|
|
1819
|
-
className: classes.popper,
|
|
1820
|
-
open: open,
|
|
1821
|
-
anchorEl: anchor.current,
|
|
1822
|
-
transition: true,
|
|
1823
|
-
placement: "right-start"
|
|
1824
|
-
}, React.createElement(ClickAwayListener, {
|
|
1825
|
-
onClickAway: function onClickAway() {
|
|
1826
|
-
return setOpen(false);
|
|
1827
|
-
}
|
|
1828
|
-
}, React.createElement(Paper, {
|
|
1829
|
-
className: classes.paper
|
|
1830
|
-
}, menuItem.children.map(function (subMenuItem) {
|
|
1831
|
-
var linkProps = subMenuItem.external ? {
|
|
1832
|
-
href: subMenuItem.url,
|
|
1833
|
-
target: "_blank"
|
|
1834
|
-
} : {};
|
|
1835
|
-
return React.createElement(Typography, Object.assign({
|
|
1836
|
-
"aria-label": subMenuItem.ariaLabel,
|
|
1837
|
-
component: subMenuItem.external ? "a" : "button",
|
|
1838
|
-
className: clsx(classes.label, classes.subMenuLabel),
|
|
1839
|
-
key: subMenuItem.url,
|
|
1840
|
-
onClick: function onClick(event) {
|
|
1841
|
-
return handleClick(event, subMenuItem);
|
|
1842
|
-
},
|
|
1843
|
-
"data-test": "submenu-item-label",
|
|
1844
|
-
"data-test-id": subMenuItem.id,
|
|
1845
|
-
variant: "body2"
|
|
1846
|
-
}, linkProps), subMenuItem.label);
|
|
1847
|
-
})))));
|
|
1848
|
-
};
|
|
1849
|
-
MenuItem.displayName = "MenuItem";
|
|
1850
|
-
|
|
1851
|
-
var useStyles$8 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1852
|
-
return {
|
|
1853
|
-
expandButton: {
|
|
1854
|
-
marginLeft: theme.spacing(2)
|
|
1855
|
-
},
|
|
1856
|
-
"float": {
|
|
1857
|
-
height: "100vh",
|
|
1858
|
-
position: "fixed",
|
|
1859
|
-
paddingRight: "2em",
|
|
1860
|
-
overflowY: "auto"
|
|
1861
|
-
},
|
|
1862
|
-
logo: {
|
|
1863
|
-
margin: "36px 0 " + theme.spacing(3) + " " + theme.spacing(3.5)
|
|
1864
|
-
},
|
|
1865
|
-
root: {
|
|
1866
|
-
transition: "width 0.5s ease",
|
|
1867
|
-
minWidth: menuWidth,
|
|
1868
|
-
width: menuWidth,
|
|
1869
|
-
zIndex: 100
|
|
1870
|
-
},
|
|
1871
|
-
rootShrink: {
|
|
1872
|
-
minWidth: shrunkMenuWidth,
|
|
1873
|
-
width: shrunkMenuWidth
|
|
1874
|
-
},
|
|
1875
|
-
toolbarContainer: {
|
|
1876
|
-
margin: theme.spacing(1, 0, 1, 2)
|
|
1877
|
-
}
|
|
1878
|
-
};
|
|
1879
|
-
}, {
|
|
1880
|
-
name: "SideBar"
|
|
1881
|
-
});
|
|
1882
|
-
var Sidebar = function Sidebar(_ref) {
|
|
1883
|
-
var _clsx;
|
|
1884
|
-
|
|
1885
|
-
var active = _ref.active,
|
|
1886
|
-
menuItems = _ref.menuItems,
|
|
1887
|
-
toolbar = _ref.toolbar,
|
|
1888
|
-
onMenuItemClick = _ref.onMenuItemClick;
|
|
1889
|
-
var theme = useTheme();
|
|
1890
|
-
var classes = useStyles$8({});
|
|
1891
|
-
|
|
1892
|
-
var _useLocalStorage = useLocalStorage(localStorageKeys.menuShrink, false.toString()),
|
|
1893
|
-
isShrunkStr = _useLocalStorage.value,
|
|
1894
|
-
setShrink = _useLocalStorage.setValue;
|
|
1895
|
-
|
|
1896
|
-
var isShrunk = isShrunkStr === "true";
|
|
1897
|
-
return React.createElement("div", {
|
|
1898
|
-
className: clsx(classes.root, (_clsx = {}, _clsx[classes.rootShrink] = isShrunk, _clsx))
|
|
1899
|
-
}, React.createElement("div", {
|
|
1900
|
-
className: classes["float"]
|
|
1901
|
-
}, React.createElement("div", {
|
|
1902
|
-
className: classes.logo
|
|
1903
|
-
}, theme.themeType === "light" ? React.createElement(Logo, null) : React.createElement(LogoLight, null)), menuItems.map(function (menuItem) {
|
|
1904
|
-
return React.createElement(MenuItem, {
|
|
1905
|
-
active: active === menuItem.id,
|
|
1906
|
-
isMenuShrunk: isShrunk,
|
|
1907
|
-
menuItem: menuItem,
|
|
1908
|
-
onClick: onMenuItemClick,
|
|
1909
|
-
key: menuItem.ariaLabel
|
|
1910
|
-
});
|
|
1911
|
-
}), toolbar && React.createElement("div", {
|
|
1912
|
-
className: classes.toolbarContainer
|
|
1913
|
-
}, toolbar), React.createElement(ExpandButton, {
|
|
1914
|
-
className: classes.expandButton,
|
|
1915
|
-
isShrunk: isShrunk,
|
|
1916
|
-
onClick: function onClick() {
|
|
1917
|
-
return setShrink((!isShrunk).toString());
|
|
1918
|
-
}
|
|
1919
|
-
})));
|
|
1920
|
-
};
|
|
1921
|
-
Sidebar.displayName = "SideBar";
|
|
1922
|
-
|
|
1923
|
-
var useStyles$9 = /*#__PURE__*/makeStyles(function (theme) {
|
|
1924
|
-
return {
|
|
1925
|
-
activeMenuLabel: {
|
|
1926
|
-
display: "flex"
|
|
1927
|
-
},
|
|
1928
|
-
container: {
|
|
1929
|
-
overflowX: "hidden",
|
|
1930
|
-
width: "100%"
|
|
1931
|
-
},
|
|
1932
|
-
containerSubMenu: {
|
|
1933
|
-
"&$container": {
|
|
1934
|
-
overflow: "hidden"
|
|
1935
|
-
}
|
|
1936
|
-
},
|
|
1937
|
-
content: {
|
|
1938
|
-
width: "50%"
|
|
1939
|
-
},
|
|
1940
|
-
icon: {
|
|
1941
|
-
marginRight: theme.spacing(2)
|
|
1942
|
-
},
|
|
1943
|
-
innerContainer: {
|
|
1944
|
-
display: "flex",
|
|
1945
|
-
position: "relative",
|
|
1946
|
-
right: 0,
|
|
1947
|
-
transition: theme.transitions.duration["short"] + "ms",
|
|
1948
|
-
width: "200%"
|
|
1949
|
-
},
|
|
1950
|
-
label: {
|
|
1951
|
-
fontWeight: "bold"
|
|
1952
|
-
},
|
|
1953
|
-
logo: {
|
|
1954
|
-
display: "block",
|
|
1955
|
-
marginBottom: theme.spacing(4)
|
|
1956
|
-
},
|
|
1957
|
-
menuItemBtn: {
|
|
1958
|
-
alignItems: "center",
|
|
1959
|
-
background: "none",
|
|
1960
|
-
border: "none",
|
|
1961
|
-
color: theme.palette.text.secondary,
|
|
1962
|
-
display: "flex",
|
|
1963
|
-
marginBottom: theme.spacing(3),
|
|
1964
|
-
padding: 0,
|
|
1965
|
-
textDecoration: "none"
|
|
1966
|
-
},
|
|
1967
|
-
root: {
|
|
1968
|
-
background: theme.palette.background["default"],
|
|
1969
|
-
borderBottomRightRadius: 32,
|
|
1970
|
-
borderTopRightRadius: 32,
|
|
1971
|
-
padding: theme.spacing(3),
|
|
1972
|
-
width: 260
|
|
1973
|
-
},
|
|
1974
|
-
secondaryContentActive: {
|
|
1975
|
-
right: "100%"
|
|
1976
|
-
},
|
|
1977
|
-
subMenuTopBar: {
|
|
1978
|
-
alignItems: "center",
|
|
1979
|
-
display: "flex",
|
|
1980
|
-
justifyContent: "space-between",
|
|
1981
|
-
marginBottom: theme.spacing(3)
|
|
1982
|
-
}
|
|
1983
|
-
};
|
|
1984
|
-
}, {
|
|
1985
|
-
name: "SideBarDrawer"
|
|
1986
|
-
});
|
|
1987
|
-
|
|
1988
|
-
var MenuItemBtn = function MenuItemBtn(_ref) {
|
|
1989
|
-
var menuItem = _ref.menuItem,
|
|
1990
|
-
_onClick = _ref.onClick;
|
|
1991
|
-
var classes = useStyles$9();
|
|
1992
|
-
var linkProps = menuItem.external ? {
|
|
1993
|
-
href: menuItem.url,
|
|
1994
|
-
target: "_blank"
|
|
1995
|
-
} : {};
|
|
1996
|
-
var Component = menuItem.external ? "a" : "button";
|
|
1997
|
-
return React.createElement(Component, Object.assign({
|
|
1998
|
-
className: classes.menuItemBtn,
|
|
1999
|
-
"data-test": "menu-item-label",
|
|
2000
|
-
"data-test-id": menuItem.id,
|
|
2001
|
-
onClick: function onClick() {
|
|
2002
|
-
return _onClick(menuItem.url);
|
|
2003
|
-
}
|
|
2004
|
-
}, linkProps), menuItem.iconSrc && React.createElement(SVG, {
|
|
2005
|
-
className: classes.icon,
|
|
2006
|
-
src: menuItem.iconSrc
|
|
2007
|
-
}), React.createElement(Typography, {
|
|
2008
|
-
"aria-label": menuItem.ariaLabel,
|
|
2009
|
-
className: classes.label
|
|
2010
|
-
}, menuItem.label));
|
|
2011
|
-
};
|
|
2012
|
-
MenuItemBtn.displayName = "MenuItemBtn";
|
|
2013
|
-
|
|
2014
|
-
var SidebarDrawer = function SidebarDrawer(_ref) {
|
|
2015
|
-
var _clsx, _clsx2, _activeMenu$children;
|
|
2016
|
-
|
|
2017
|
-
var menuItems = _ref.menuItems,
|
|
2018
|
-
onMenuItemClick = _ref.onMenuItemClick;
|
|
2019
|
-
var theme = useTheme();
|
|
2020
|
-
|
|
2021
|
-
var _React$useState = React.useState(false),
|
|
2022
|
-
isOpened = _React$useState[0],
|
|
2023
|
-
setOpened = _React$useState[1];
|
|
2024
|
-
|
|
2025
|
-
var classes = useStyles$9({});
|
|
2026
|
-
|
|
2027
|
-
var _React$useState2 = React.useState(null),
|
|
2028
|
-
activeMenu = _React$useState2[0],
|
|
2029
|
-
setActiveMenu = _React$useState2[1];
|
|
2030
|
-
|
|
2031
|
-
var _React$useState3 = React.useState(false),
|
|
2032
|
-
showSubmenu = _React$useState3[0],
|
|
2033
|
-
setShowSubmenu = _React$useState3[1];
|
|
2034
|
-
|
|
2035
|
-
var container = React.useRef(null);
|
|
2036
|
-
|
|
2037
|
-
var handleMenuItemClick = function handleMenuItemClick(url) {
|
|
2038
|
-
setOpened(false);
|
|
2039
|
-
setShowSubmenu(false);
|
|
2040
|
-
onMenuItemClick(url);
|
|
2041
|
-
};
|
|
2042
|
-
|
|
2043
|
-
var handleMenuItemWithChildrenClick = function handleMenuItemWithChildrenClick(menuItem) {
|
|
2044
|
-
var _container$current;
|
|
2045
|
-
|
|
2046
|
-
setActiveMenu(menuItem);
|
|
2047
|
-
setShowSubmenu(true);
|
|
2048
|
-
(_container$current = container.current) == null ? void 0 : _container$current.scrollTo({
|
|
2049
|
-
top: 0
|
|
2050
|
-
});
|
|
2051
|
-
};
|
|
2052
|
-
|
|
2053
|
-
return React.createElement(React.Fragment, null, React.createElement(SquareButton, {
|
|
2054
|
-
onClick: function onClick() {
|
|
2055
|
-
return setOpened(true);
|
|
2056
|
-
}
|
|
2057
|
-
}, React.createElement(MenuIcon, null)), React.createElement(Drawer, {
|
|
2058
|
-
classes: {
|
|
2059
|
-
paper: classes.root
|
|
2060
|
-
},
|
|
2061
|
-
open: isOpened,
|
|
2062
|
-
onClose: function onClose() {
|
|
2063
|
-
return setOpened(false);
|
|
2064
|
-
}
|
|
2065
|
-
}, React.createElement("div", {
|
|
2066
|
-
className: clsx(classes.container, (_clsx = {}, _clsx[classes.containerSubMenu] = showSubmenu, _clsx)),
|
|
2067
|
-
ref: container
|
|
2068
|
-
}, React.createElement("div", {
|
|
2069
|
-
className: clsx(classes.innerContainer, (_clsx2 = {}, _clsx2[classes.secondaryContentActive] = showSubmenu, _clsx2))
|
|
2070
|
-
}, React.createElement("div", {
|
|
2071
|
-
className: classes.content
|
|
2072
|
-
}, React.createElement("div", {
|
|
2073
|
-
className: classes.logo
|
|
2074
|
-
}, theme.themeType === "light" ? React.createElement(Logo, null) : React.createElement(LogoLight, null)), menuItems.map(function (menuItem) {
|
|
2075
|
-
return React.createElement(MenuItemBtn, {
|
|
2076
|
-
menuItem: menuItem,
|
|
2077
|
-
onClick: menuItem.children ? function () {
|
|
2078
|
-
return handleMenuItemWithChildrenClick(menuItem);
|
|
2079
|
-
} : handleMenuItemClick,
|
|
2080
|
-
key: menuItem.ariaLabel
|
|
2081
|
-
});
|
|
2082
|
-
})), activeMenu && React.createElement("div", {
|
|
2083
|
-
className: classes.content
|
|
2084
|
-
}, React.createElement("div", {
|
|
2085
|
-
className: classes.subMenuTopBar
|
|
2086
|
-
}, React.createElement("div", {
|
|
2087
|
-
className: classes.activeMenuLabel
|
|
2088
|
-
}, activeMenu.iconSrc && React.createElement(SVG, {
|
|
2089
|
-
className: classes.icon,
|
|
2090
|
-
src: activeMenu.iconSrc
|
|
2091
|
-
}), React.createElement(Typography, {
|
|
2092
|
-
className: classes.label
|
|
2093
|
-
}, activeMenu.label)), React.createElement(SquareButton, {
|
|
2094
|
-
onClick: function onClick() {
|
|
2095
|
-
return setShowSubmenu(false);
|
|
2096
|
-
}
|
|
2097
|
-
}, React.createElement(ArrowLeftIcon, null))), (_activeMenu$children = activeMenu.children) == null ? void 0 : _activeMenu$children.map(function (subMenuItem) {
|
|
2098
|
-
return React.createElement(MenuItemBtn, {
|
|
2099
|
-
menuItem: subMenuItem,
|
|
2100
|
-
onClick: handleMenuItemClick,
|
|
2101
|
-
key: subMenuItem.ariaLabel
|
|
2102
|
-
});
|
|
2103
|
-
}))))));
|
|
2104
|
-
};
|
|
2105
|
-
SidebarDrawer.displayName = "SideBarDrawer";
|
|
2106
|
-
|
|
2107
|
-
var useStyles$a = /*#__PURE__*/makeStyles(function (theme) {
|
|
2108
|
-
return {
|
|
2109
|
-
close: {
|
|
2110
|
-
color: theme.palette.common.black,
|
|
2111
|
-
position: "absolute",
|
|
2112
|
-
right: theme.spacing(-2),
|
|
2113
|
-
top: theme.spacing(-1)
|
|
2114
|
-
},
|
|
2115
|
-
closeNoContent: {
|
|
2116
|
-
"&$close": {
|
|
2117
|
-
right: theme.spacing(-3),
|
|
2118
|
-
top: theme.spacing(-3)
|
|
2119
|
-
}
|
|
2120
|
-
},
|
|
2121
|
-
container: {
|
|
2122
|
-
columnGap: theme.spacing(2),
|
|
2123
|
-
display: "grid",
|
|
2124
|
-
gridTemplateColumns: "40px 1fr"
|
|
2125
|
-
},
|
|
2126
|
-
content: {
|
|
2127
|
-
padding: theme.spacing(0, 1)
|
|
2128
|
-
},
|
|
2129
|
-
root: {},
|
|
2130
|
-
titleBar: {
|
|
2131
|
-
marginTop: 6,
|
|
2132
|
-
marginBottom: theme.spacing(1),
|
|
2133
|
-
position: "relative"
|
|
2134
|
-
},
|
|
2135
|
-
error: {
|
|
2136
|
-
background: theme.palette.alert.paper.error
|
|
2137
|
-
},
|
|
2138
|
-
warning: {
|
|
2139
|
-
background: theme.palette.alert.paper.warning
|
|
2140
|
-
},
|
|
2141
|
-
success: {
|
|
2142
|
-
background: theme.palette.alert.paper.success
|
|
2143
|
-
}
|
|
2144
|
-
};
|
|
2145
|
-
}, {
|
|
2146
|
-
name: "Alert"
|
|
2147
|
-
});
|
|
2148
|
-
|
|
2149
|
-
function getIcon(variant) {
|
|
2150
|
-
switch (variant) {
|
|
2151
|
-
case "error":
|
|
2152
|
-
return React.createElement(NotAllowedIcon, null);
|
|
2153
|
-
|
|
2154
|
-
case "success":
|
|
2155
|
-
return React.createElement(CompleteIcon, null);
|
|
2156
|
-
|
|
2157
|
-
case "warning":
|
|
2158
|
-
return React.createElement(WarningIcon, null);
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
return React.createElement(InfoIcon, null);
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
var Alert = function Alert(_ref) {
|
|
2165
|
-
var _clsx, _clsx2;
|
|
2166
|
-
|
|
2167
|
-
var className = _ref.className,
|
|
2168
|
-
_ref$close = _ref.close,
|
|
2169
|
-
close = _ref$close === void 0 ? true : _ref$close,
|
|
2170
|
-
_ref$variant = _ref.variant,
|
|
2171
|
-
variant = _ref$variant === void 0 ? "info" : _ref$variant,
|
|
2172
|
-
title = _ref.title,
|
|
2173
|
-
children = _ref.children;
|
|
2174
|
-
var classes = useStyles$a();
|
|
2175
|
-
|
|
2176
|
-
var _React$useState = React.useState(true),
|
|
2177
|
-
visible = _React$useState[0],
|
|
2178
|
-
setVisible = _React$useState[1];
|
|
2179
|
-
|
|
2180
|
-
if (!visible) {
|
|
2181
|
-
return null;
|
|
2182
|
-
}
|
|
2183
|
-
|
|
2184
|
-
return React.createElement(Card, {
|
|
2185
|
-
elevation: 0,
|
|
2186
|
-
className: clsx(className, classes.root, (_clsx = {}, _clsx[classes.error] = variant === "error", _clsx[classes.warning] = variant === "warning", _clsx[classes.success] = variant === "success", _clsx)),
|
|
2187
|
-
"data-test": "alert"
|
|
2188
|
-
}, React.createElement(CardContent, null, React.createElement("div", {
|
|
2189
|
-
className: classes.container
|
|
2190
|
-
}, React.createElement("div", null, getIcon(variant)), React.createElement("div", {
|
|
2191
|
-
className: classes.content
|
|
2192
|
-
}, React.createElement("div", {
|
|
2193
|
-
className: classes.titleBar
|
|
2194
|
-
}, title && React.createElement(Typography, {
|
|
2195
|
-
variant: "h5"
|
|
2196
|
-
}, title), close && React.createElement(IconButton, {
|
|
2197
|
-
className: clsx(classes.close, (_clsx2 = {}, _clsx2[classes.closeNoContent] = !!children, _clsx2)),
|
|
2198
|
-
onClick: function onClick() {
|
|
2199
|
-
return setVisible(false);
|
|
2200
|
-
},
|
|
2201
|
-
"data-test": "close"
|
|
2202
|
-
}, React.createElement(CloseIcon, null))), typeof children === "string" ? React.createElement(Typography, {
|
|
2203
|
-
variant: "body1"
|
|
2204
|
-
}, children) : children))));
|
|
2205
|
-
};
|
|
2206
|
-
Alert.displayName = "Alert";
|
|
2207
|
-
|
|
2208
|
-
var iconWidth = 40;
|
|
2209
|
-
var useStyles$b = /*#__PURE__*/makeStyles(function (theme) {
|
|
2210
|
-
return {
|
|
2211
|
-
actionBtn: {
|
|
2212
|
-
left: -4,
|
|
2213
|
-
position: "relative",
|
|
2214
|
-
minWidth: "unset"
|
|
2215
|
-
},
|
|
2216
|
-
closeBtn: {
|
|
2217
|
-
"& svg": {
|
|
2218
|
-
maxHeight: 20,
|
|
2219
|
-
maxWidth: 20
|
|
2220
|
-
},
|
|
2221
|
-
padding: 10,
|
|
2222
|
-
position: "absolute",
|
|
2223
|
-
right: 5,
|
|
2224
|
-
top: 7
|
|
2225
|
-
},
|
|
2226
|
-
closeBtnInfo: {
|
|
2227
|
-
color: theme.palette.text.primary
|
|
2228
|
-
},
|
|
2229
|
-
error: {
|
|
2230
|
-
backgroundColor: theme.palette.alert.paper.error
|
|
2231
|
-
},
|
|
2232
|
-
hiddenText: {
|
|
2233
|
-
maxHeight: 0
|
|
2234
|
-
},
|
|
2235
|
-
info: {},
|
|
2236
|
-
snackbar: {
|
|
2237
|
-
borderRadius: 4,
|
|
2238
|
-
padding: theme.spacing(0, 6, 1, 2),
|
|
2239
|
-
position: "relative"
|
|
2240
|
-
},
|
|
2241
|
-
snackbarContainer: {
|
|
2242
|
-
marginBottom: theme.spacing(2),
|
|
2243
|
-
maxWidth: 450,
|
|
2244
|
-
position: "relative"
|
|
2245
|
-
},
|
|
2246
|
-
snackbarAction: {
|
|
2247
|
-
paddingLeft: "calc(" + iconWidth + "px + " + theme.spacing(2) + ")"
|
|
2248
|
-
},
|
|
2249
|
-
success: {
|
|
2250
|
-
backgroundColor: theme.palette.alert.paper.success
|
|
2251
|
-
},
|
|
2252
|
-
text: {
|
|
2253
|
-
fontWeight: 400,
|
|
2254
|
-
paddingTop: 5
|
|
2255
|
-
},
|
|
2256
|
-
warning: {
|
|
2257
|
-
backgroundColor: theme.palette.alert.paper.warning
|
|
2258
|
-
},
|
|
2259
|
-
messageContainer: {
|
|
2260
|
-
paddingTop: theme.spacing(2),
|
|
2261
|
-
position: "relative"
|
|
2262
|
-
},
|
|
2263
|
-
container: {
|
|
2264
|
-
columnGap: theme.spacing(2),
|
|
2265
|
-
display: "grid",
|
|
2266
|
-
gridTemplateColumns: iconWidth + "px 1fr"
|
|
2267
|
-
},
|
|
2268
|
-
title: {
|
|
2269
|
-
marginTop: 6,
|
|
2270
|
-
marginBottom: theme.spacing(0.5)
|
|
2271
|
-
}
|
|
2272
|
-
};
|
|
2273
|
-
}, {
|
|
2274
|
-
name: "Notification"
|
|
2275
|
-
});
|
|
2276
|
-
|
|
2277
|
-
function getIcon$1(variant) {
|
|
2278
|
-
switch (variant) {
|
|
2279
|
-
case "error":
|
|
2280
|
-
return React.createElement(NotAllowedIcon, null);
|
|
2281
|
-
|
|
2282
|
-
case "success":
|
|
2283
|
-
return React.createElement(CompleteIcon, null);
|
|
2284
|
-
|
|
2285
|
-
case "warning":
|
|
2286
|
-
return React.createElement(WarningIcon, null);
|
|
2287
|
-
}
|
|
2288
|
-
|
|
2289
|
-
return React.createElement(InfoIcon, null);
|
|
2290
|
-
}
|
|
2291
|
-
|
|
2292
|
-
var Notification = function Notification(_ref) {
|
|
2293
|
-
var _clsx, _clsx2;
|
|
2294
|
-
|
|
2295
|
-
var onClose = _ref.onClose,
|
|
2296
|
-
title = _ref.title,
|
|
2297
|
-
type = _ref.type,
|
|
2298
|
-
action = _ref.action,
|
|
2299
|
-
content = _ref.content,
|
|
2300
|
-
className = _ref.className,
|
|
2301
|
-
rest = _objectWithoutPropertiesLoose(_ref, ["onClose", "title", "type", "action", "content", "className"]);
|
|
2302
|
-
|
|
2303
|
-
var classes = useStyles$b();
|
|
2304
|
-
return React.createElement("div", Object.assign({
|
|
2305
|
-
className: clsx(classes.snackbarContainer, className),
|
|
2306
|
-
"data-test": "notification",
|
|
2307
|
-
"data-test-type": type
|
|
2308
|
-
}, rest), React.createElement(SnackbarContent, {
|
|
2309
|
-
"aria-describedby": "client-snackbar",
|
|
2310
|
-
classes: {
|
|
2311
|
-
action: classes.snackbarAction,
|
|
2312
|
-
message: classes.messageContainer
|
|
2313
|
-
},
|
|
2314
|
-
className: clsx(classes.snackbar, (_clsx = {}, _clsx[classes.info] = type === "info", _clsx[classes.error] = type === "error", _clsx[classes.success] = type === "success", _clsx[classes.warning] = type === "warning", _clsx)),
|
|
2315
|
-
message: React.createElement("div", {
|
|
2316
|
-
className: classes.container
|
|
2317
|
-
}, React.createElement("div", null, getIcon$1(type)), React.createElement("div", null, React.createElement("div", {
|
|
2318
|
-
className: classes.title
|
|
2319
|
-
}, React.createElement(Typography, {
|
|
2320
|
-
variant: "h5"
|
|
2321
|
-
}, title)), React.createElement(Typography, {
|
|
2322
|
-
variant: "body1"
|
|
2323
|
-
}, content))),
|
|
2324
|
-
action: [React.createElement("div", {
|
|
2325
|
-
key: "actions"
|
|
2326
|
-
}, !!action && React.createElement(Button, {
|
|
2327
|
-
className: classes.actionBtn,
|
|
2328
|
-
key: "action",
|
|
2329
|
-
color: "default",
|
|
2330
|
-
size: "small",
|
|
2331
|
-
onClick: action.onClick,
|
|
2332
|
-
"data-test": "button-action"
|
|
2333
|
-
}, action.label)), React.createElement(IconButton, {
|
|
2334
|
-
key: "close",
|
|
2335
|
-
"aria-label": "Close",
|
|
2336
|
-
color: "inherit",
|
|
2337
|
-
onClick: onClose,
|
|
2338
|
-
className: clsx(classes.closeBtn, (_clsx2 = {}, _clsx2[classes.closeBtnInfo] = type === "info", _clsx2)),
|
|
2339
|
-
"data-test": "close"
|
|
2340
|
-
}, React.createElement(CloseIcon, null))]
|
|
2341
|
-
}));
|
|
2342
|
-
};
|
|
2343
|
-
Notification.displayName = "Notification";
|
|
2344
|
-
|
|
2345
|
-
var UserChipMenuContext = /*#__PURE__*/createContext(undefined);
|
|
2346
|
-
UserChipMenuContext.displayName = "UserChipMenuContext";
|
|
2347
|
-
var useUserChipMenu = function useUserChipMenu() {
|
|
2348
|
-
var ctx = useContext(UserChipMenuContext);
|
|
2349
|
-
|
|
2350
|
-
if (ctx === undefined) {
|
|
2351
|
-
throw new Error("useUserChipMenu must be used within a UserChipMenuContext");
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
return ctx;
|
|
2355
|
-
};
|
|
2356
|
-
|
|
2357
|
-
var useStyles$c = /*#__PURE__*/makeStyles(function (theme) {
|
|
2358
|
-
var _arrow, _, _userChip;
|
|
2359
|
-
|
|
2360
|
-
return {
|
|
2361
|
-
arrow: (_arrow = {}, _arrow[theme.breakpoints.down("sm")] = {
|
|
2362
|
-
marginLeft: 0
|
|
2363
|
-
}, _arrow.marginLeft = theme.spacing(2), _arrow.transition = theme.transitions.duration.standard + "ms", _arrow),
|
|
2364
|
-
avatar: {
|
|
2365
|
-
"&&": (_ = {}, _[theme.breakpoints.down("sm")] = {
|
|
2366
|
-
height: 40,
|
|
2367
|
-
width: 40
|
|
2368
|
-
}, _.height = 32, _.width = 32, _)
|
|
2369
|
-
},
|
|
2370
|
-
avatarInitials: {
|
|
2371
|
-
color: theme.palette.primary.contrastText
|
|
2372
|
-
},
|
|
2373
|
-
avatarPlaceholder: {
|
|
2374
|
-
alignItems: "center",
|
|
2375
|
-
background: theme.palette.primary.main,
|
|
2376
|
-
borderRadius: "100%",
|
|
2377
|
-
display: "flex",
|
|
2378
|
-
justifyContent: "center"
|
|
2379
|
-
},
|
|
2380
|
-
label: {
|
|
2381
|
-
lineHeight: 1.2
|
|
2382
|
-
},
|
|
2383
|
-
labelContainer: {
|
|
2384
|
-
display: "inline-flex",
|
|
2385
|
-
alignItems: "center"
|
|
2386
|
-
},
|
|
2387
|
-
popover: {
|
|
2388
|
-
marginTop: theme.spacing(2),
|
|
2389
|
-
zIndex: 10
|
|
2390
|
-
},
|
|
2391
|
-
rotate: {
|
|
2392
|
-
transform: "rotate(180deg)"
|
|
2393
|
-
},
|
|
2394
|
-
userChip: (_userChip = {}, _userChip[theme.breakpoints.down("sm")] = {
|
|
2395
|
-
height: 48
|
|
2396
|
-
}, _userChip.backgroundColor = theme.palette.background.paper, _userChip.borderRadius = 24, _userChip.color = theme.palette.text.primary, _userChip.height = 40, _userChip.padding = theme.spacing(0.5), _userChip),
|
|
2397
|
-
userMenuContainer: {
|
|
2398
|
-
position: "relative"
|
|
2399
|
-
}
|
|
2400
|
-
};
|
|
2401
|
-
}, {
|
|
2402
|
-
name: "UserChipMenu"
|
|
2403
|
-
});
|
|
2404
|
-
|
|
2405
|
-
var UserChipMenu = function UserChipMenu(_ref) {
|
|
2406
|
-
var _clsx;
|
|
2407
|
-
|
|
2408
|
-
var avatar = _ref.avatar,
|
|
2409
|
-
initials = _ref.initials,
|
|
2410
|
-
name = _ref.name,
|
|
2411
|
-
subtext = _ref.subtext,
|
|
2412
|
-
children = _ref.children,
|
|
2413
|
-
props = _objectWithoutPropertiesLoose(_ref, ["avatar", "initials", "name", "subtext", "children"]);
|
|
2414
|
-
|
|
2415
|
-
var classes = useStyles$c({});
|
|
2416
|
-
|
|
2417
|
-
var _React$useState = React.useState(false),
|
|
2418
|
-
isMenuOpened = _React$useState[0],
|
|
2419
|
-
setMenuState = _React$useState[1];
|
|
2420
|
-
|
|
2421
|
-
var anchor = React.useRef(null);
|
|
2422
|
-
|
|
2423
|
-
var closeMenu = function closeMenu() {
|
|
2424
|
-
return setMenuState(false);
|
|
2425
|
-
};
|
|
2426
|
-
|
|
2427
|
-
return React.createElement("div", Object.assign({
|
|
2428
|
-
className: classes.userMenuContainer
|
|
2429
|
-
}, props), React.createElement(Chip, {
|
|
2430
|
-
avatar: avatar ? React.createElement(Avatar, {
|
|
2431
|
-
alt: "user",
|
|
2432
|
-
src: avatar
|
|
2433
|
-
}) : React.createElement("div", {
|
|
2434
|
-
className: classes.avatarPlaceholder
|
|
2435
|
-
}, React.createElement("div", {
|
|
2436
|
-
className: classes.avatarInitials
|
|
2437
|
-
}, initials)),
|
|
2438
|
-
classes: {
|
|
2439
|
-
avatar: classes.avatar
|
|
2440
|
-
},
|
|
2441
|
-
className: classes.userChip,
|
|
2442
|
-
label: React.createElement("div", {
|
|
2443
|
-
className: classes.labelContainer
|
|
2444
|
-
}, React.createElement(Hidden, {
|
|
2445
|
-
smDown: true
|
|
2446
|
-
}, React.createElement("div", null, React.createElement(Typography, {
|
|
2447
|
-
className: classes.label,
|
|
2448
|
-
variant: "body2"
|
|
2449
|
-
}, name), subtext && React.createElement(Typography, {
|
|
2450
|
-
className: classes.label,
|
|
2451
|
-
variant: "body2",
|
|
2452
|
-
color: "textSecondary"
|
|
2453
|
-
}, subtext))), React.createElement(ArrowDropdownIcon, {
|
|
2454
|
-
className: clsx(classes.arrow, (_clsx = {}, _clsx[classes.rotate] = isMenuOpened, _clsx))
|
|
2455
|
-
})),
|
|
2456
|
-
onClick: function onClick() {
|
|
2457
|
-
return setMenuState(!isMenuOpened);
|
|
2458
|
-
},
|
|
2459
|
-
ref: anchor,
|
|
2460
|
-
"data-test": "userMenu"
|
|
2461
|
-
}), React.createElement(Popper, {
|
|
2462
|
-
className: classes.popover,
|
|
2463
|
-
open: isMenuOpened,
|
|
2464
|
-
anchorEl: anchor.current,
|
|
2465
|
-
transition: true,
|
|
2466
|
-
placement: "bottom-end"
|
|
2467
|
-
}, function (_ref2) {
|
|
2468
|
-
var TransitionProps = _ref2.TransitionProps,
|
|
2469
|
-
placement = _ref2.placement;
|
|
2470
|
-
return React.createElement(Grow, Object.assign({}, TransitionProps, {
|
|
2471
|
-
style: {
|
|
2472
|
-
transformOrigin: placement === "bottom" ? "right top" : "right bottom"
|
|
2473
|
-
}
|
|
2474
|
-
}), React.createElement(Paper, null, React.createElement(ClickAwayListener, {
|
|
2475
|
-
onClickAway: closeMenu,
|
|
2476
|
-
mouseEvent: "onClick"
|
|
2477
|
-
}, React.createElement(Menu, null, React.createElement(UserChipMenuContext.Provider, {
|
|
2478
|
-
value: closeMenu
|
|
2479
|
-
}, children)))));
|
|
2480
|
-
}));
|
|
2481
|
-
};
|
|
2482
|
-
UserChipMenu.displayName = "UserChip";
|
|
2483
|
-
|
|
2484
|
-
var UserChipMenuItem = function UserChipMenuItem(_ref) {
|
|
2485
|
-
var leaveOpen = _ref.leaveOpen,
|
|
2486
|
-
onClick = _ref.onClick,
|
|
2487
|
-
props = _objectWithoutPropertiesLoose(_ref, ["leaveOpen", "onClick"]);
|
|
2488
|
-
|
|
2489
|
-
var closeMenu = useUserChipMenu(); // We're not really interested in event type here
|
|
2490
|
-
|
|
2491
|
-
var handleClickWithClose = function handleClickWithClose(event) {
|
|
2492
|
-
closeMenu();
|
|
2493
|
-
|
|
2494
|
-
if (onClick) {
|
|
2495
|
-
onClick(event);
|
|
2496
|
-
}
|
|
2497
|
-
};
|
|
2498
|
-
|
|
2499
|
-
return React.createElement(MenuItem$1, Object.assign({}, props, {
|
|
2500
|
-
onClick: leaveOpen ? onClick : handleClickWithClose,
|
|
2501
|
-
button: true
|
|
2502
|
-
}));
|
|
2503
|
-
};
|
|
2504
|
-
UserChipMenuItem.displayName = "UserChipMenuItem";
|
|
2505
|
-
|
|
2506
|
-
var useStyles$d = /*#__PURE__*/makeStyles(function (theme) {
|
|
2507
|
-
var _root;
|
|
2508
|
-
|
|
2509
|
-
return {
|
|
2510
|
-
root: (_root = {}, _root[theme.breakpoints.up("md")] = {
|
|
2511
|
-
"&& table": {
|
|
2512
|
-
tableLayout: "fixed"
|
|
2513
|
-
}
|
|
2514
|
-
}, _root["& table"] = {
|
|
2515
|
-
tableLayout: "auto"
|
|
2516
|
-
}, _root.overflowX = "auto", _root.width = "100%", _root)
|
|
2517
|
-
};
|
|
2518
|
-
}, {
|
|
2519
|
-
name: "ResponsiveTable"
|
|
2520
|
-
});
|
|
2521
|
-
|
|
2522
|
-
var ResponsiveTable = function ResponsiveTable(props) {
|
|
2523
|
-
var children = props.children,
|
|
2524
|
-
className = props.className;
|
|
2525
|
-
var classes = useStyles$d(props);
|
|
2526
|
-
return React.createElement("div", {
|
|
2527
|
-
className: classes.root
|
|
2528
|
-
}, React.createElement(Table, {
|
|
2529
|
-
className: className
|
|
2530
|
-
}, children));
|
|
2531
|
-
};
|
|
2532
|
-
ResponsiveTable.displayName = "ResponsiveTable";
|
|
2533
|
-
|
|
2534
|
-
var useStyles$e = /*#__PURE__*/makeStyles(function (theme) {
|
|
2535
|
-
return {
|
|
2536
|
-
tooltip: {
|
|
2537
|
-
backgroundColor: function backgroundColor(props) {
|
|
2538
|
-
switch (props.variant) {
|
|
2539
|
-
case "info":
|
|
2540
|
-
return theme.palette.info.main;
|
|
2541
|
-
|
|
2542
|
-
case "success":
|
|
2543
|
-
return theme.palette.success.main;
|
|
2544
|
-
|
|
2545
|
-
case "warning":
|
|
2546
|
-
return theme.palette.warning.main;
|
|
2547
|
-
|
|
2548
|
-
case "error":
|
|
2549
|
-
return theme.palette.error.main;
|
|
2550
|
-
|
|
2551
|
-
default:
|
|
2552
|
-
return theme.palette.info.main;
|
|
2553
|
-
}
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
};
|
|
2557
|
-
}, {
|
|
2558
|
-
name: "Tooltip"
|
|
2559
|
-
});
|
|
2560
|
-
|
|
2561
|
-
var Tooltip = function Tooltip(_ref) {
|
|
2562
|
-
var children = _ref.children,
|
|
2563
|
-
_ref$variant = _ref.variant,
|
|
2564
|
-
variant = _ref$variant === void 0 ? "info" : _ref$variant,
|
|
2565
|
-
rest = _objectWithoutPropertiesLoose(_ref, ["children", "variant"]);
|
|
2566
|
-
|
|
2567
|
-
var classes = useStyles$e(_extends({
|
|
2568
|
-
variant: variant,
|
|
2569
|
-
children: children
|
|
2570
|
-
}, rest));
|
|
2571
|
-
return React.createElement(Tooltip$2, Object.assign({
|
|
2572
|
-
classes: classes
|
|
2573
|
-
}, rest), children);
|
|
2574
|
-
};
|
|
2575
|
-
Tooltip.displayName = "Tooltip";
|
|
2576
|
-
|
|
2577
|
-
export { ActionBar, ActionBarContext, ActionBarProvider, Alert, Backlink, BacklinkContext, BacklinkProvider, CheckboxCheckedIcon, CheckboxIcon, CheckboxIndeterminateIcon, CompleteIcon, ConfirmButton, EditIcon, ExpandButton, ExtensionMessageType, ICONBUTTON_SIZE, InfoIcon, MenuItem, MenuItemBtn, NotAllowedIcon, NotAllowedInvertedIcon, Notification, ResponsiveTable, Savebar, SearchIcon, Sidebar, SidebarDrawer, SquareButton, ThemeProvider, Tooltip, UserChipMenu, UserChipMenuItem, WarningIcon, createTheme, dark, light, makeStyles, menuWidth, sendMessageToDashboard, sendMessageToExtension, shrunkMenuWidth, useActionBar, useBacklink, useExtensionMessage, useTheme };
|
|
2578
|
-
//# sourceMappingURL=macaw-ui.esm.js.map
|