@superdispatch/ui-lab 0.25.3 → 0.26.0
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-node/index.js +118 -201
- package/dist-node/index.js.map +1 -1
- package/dist-src/alert/Alert.js +0 -4
- package/dist-src/banner/Banner.js +11 -14
- package/dist-src/box/Box.js +18 -19
- package/dist-src/button/Button.js +22 -37
- package/dist-src/button-area/ButtonArea.js +9 -11
- package/dist-src/chat/Chat.js +0 -2
- package/dist-src/chat/ChatMessage.js +1 -2
- package/dist-src/container/Container.js +3 -7
- package/dist-src/description-item/DescriptionItem.js +1 -4
- package/dist-src/description-line-item/DescriptionLineItem.js +1 -2
- package/dist-src/file-drop-zone/FileDropZone.js +26 -31
- package/dist-src/file-list-item/FileListItem.js +1 -4
- package/dist-src/linked-text/LinkedText.js +10 -13
- package/dist-src/navbar/Navbar.js +1 -2
- package/dist-src/navbar/NavbarAccordion.js +4 -8
- package/dist-src/navbar/NavbarAvatar.js +6 -10
- package/dist-src/navbar/NavbarBottomBar.js +6 -9
- package/dist-src/navbar/NavbarItem.js +1 -2
- package/dist-src/navbar/NavbarList.js +2 -8
- package/dist-src/navbar/NavbarMenu.js +1 -6
- package/dist-src/sidebar/Sidebar.js +1 -2
- package/dist-src/sidebar/SidebarBackButton.js +6 -10
- package/dist-src/sidebar/SidebarContainer.js +1 -4
- package/dist-src/sidebar/SidebarContent.js +1 -2
- package/dist-src/sidebar/SidebarMenuItem.js +1 -4
- package/dist-src/sidebar/SidebarMenuItemAvatar.js +0 -4
- package/dist-src/sidebar/SidebarSubheader.js +1 -2
- package/dist-src/text-box/TextBox.js +9 -23
- package/dist-src/utils/RuleNormalizer.js +0 -3
- package/dist-src/utils/mergeStyles.js +0 -3
- package/dist-web/index.js +118 -201
- package/dist-web/index.js.map +1 -1
- package/package.json +3 -3
package/dist-web/index.js
CHANGED
|
@@ -18,16 +18,13 @@ import { noop } from 'lodash';
|
|
|
18
18
|
function colorMixin(textColor, iconColor, backgroundColor, buttonHoverColor) {
|
|
19
19
|
return css(["color:", ";border-color:", ";background-color:", ";& .MuiAlert-icon{color:", ";}& .MuiAlert-action{color:", ";& .MuiIconButton-root{&:hover,&:active{color:", ";}}}"], textColor, textColor, backgroundColor, iconColor, iconColor, buttonHoverColor);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
21
|
var StyledAlert = /*#__PURE__*/styled(Alert$1).withConfig({
|
|
23
22
|
displayName: "Alert__StyledAlert",
|
|
24
23
|
componentId: "SD__sc-1j6qebb-0"
|
|
25
24
|
})(["&.MuiAlert-outlinedSuccess{", ";}&.MuiAlert-outlinedInfo{", ";}&.MuiAlert-outlinedWarning{", ";}&.MuiAlert-outlinedError{", ";}& .MuiAlert-icon{opacity:1;padding:8px 0;font-size:24px;}& .MuiAlert-action{display:block;padding-top:5px;margin-right:-3px;& .MuiIconButton-root{& .MuiSvgIcon-root{font-size:24px;}}}"], /*#__PURE__*/colorMixin(Color.Green500, Color.Green300, Color.Green50, Color.Green400), /*#__PURE__*/colorMixin(Color.Blue500, Color.Blue300, Color.Blue50, Color.Blue400), /*#__PURE__*/colorMixin(Color.Yellow500, Color.Yellow300, Color.Yellow50, Color.Yellow400), /*#__PURE__*/colorMixin(Color.Red500, Color.Red300, Color.Red50, Color.Red400));
|
|
26
|
-
|
|
27
25
|
function toMaterialSeverity(severity) {
|
|
28
26
|
return severity === 'info' ? 'info' : severity === 'caution' ? 'warning' : severity === 'critical' ? 'error' : 'success';
|
|
29
27
|
}
|
|
30
|
-
|
|
31
28
|
var iconMapping = {
|
|
32
29
|
success: /*#__PURE__*/jsx(CheckCircle, {}),
|
|
33
30
|
info: /*#__PURE__*/jsx(Info, {}),
|
|
@@ -54,22 +51,18 @@ var Alert = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
54
51
|
if (process.env.NODE_ENV !== "production") Alert.displayName = "Alert";
|
|
55
52
|
|
|
56
53
|
var _excluded = ["children"],
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
_excluded2 = ["in"];
|
|
59
55
|
function enterMixin(border) {
|
|
60
56
|
return css(["min-height:56px;color:", ";background-color:", ";border-", ":1px #dfe3e8 solid;"], Color.Dark500, Color.White, border);
|
|
61
57
|
}
|
|
62
|
-
|
|
63
58
|
function enterAnimation(border) {
|
|
64
59
|
return keyframes(["0%{min-height:0;color:", ";background-color:", ";}50%{min-height:56px;color:", ";background-color:", ";}70%{min-height:56px;color:", ";background-color:", ";}100%{", "}"], Color.White, Color.Dark500, Color.White, Color.Dark500, Color.White, Color.Dark500, enterMixin(border));
|
|
65
60
|
}
|
|
66
|
-
|
|
67
61
|
var CustomTransition = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
68
62
|
var {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
children
|
|
64
|
+
} = _ref,
|
|
65
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
73
66
|
return /*#__PURE__*/jsx(CSSTransition, _objectSpread(_objectSpread({}, props), {}, {
|
|
74
67
|
ref: ref,
|
|
75
68
|
timeout: 3000,
|
|
@@ -91,12 +84,12 @@ var BannerContent = /*#__PURE__*/styled(CustomTransition).withConfig({
|
|
|
91
84
|
});
|
|
92
85
|
var Banner = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
93
86
|
var {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
var [isIn, setIn] = useState(false); // transition is not triggered on initial render with `in: true`
|
|
87
|
+
in: inProp
|
|
88
|
+
} = _ref3,
|
|
89
|
+
props = _objectWithoutProperties(_ref3, _excluded2);
|
|
90
|
+
var [isIn, setIn] = useState(false);
|
|
99
91
|
|
|
92
|
+
// transition is not triggered on initial render with `in: true`
|
|
100
93
|
useEffect(() => {
|
|
101
94
|
setIn(!!inProp);
|
|
102
95
|
}, [inProp]);
|
|
@@ -111,52 +104,51 @@ function createRuleNormalizer(rules) {
|
|
|
111
104
|
return input => {
|
|
112
105
|
if (typeof input == 'string') {
|
|
113
106
|
var value = rules[input];
|
|
114
|
-
|
|
115
107
|
if (typeof value == 'number') {
|
|
116
108
|
return "".concat(value, "px");
|
|
117
109
|
}
|
|
118
|
-
|
|
119
110
|
if (typeof value == 'string') {
|
|
120
111
|
return value;
|
|
121
112
|
}
|
|
122
113
|
}
|
|
123
|
-
|
|
124
114
|
return undefined;
|
|
125
115
|
};
|
|
126
116
|
}
|
|
127
117
|
|
|
118
|
+
//
|
|
128
119
|
// Colors
|
|
129
120
|
//
|
|
130
121
|
|
|
131
122
|
function normalizeColor(input) {
|
|
132
123
|
return isColorProp(input) ? Color[input] : undefined;
|
|
133
|
-
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
//
|
|
134
127
|
// Space
|
|
135
128
|
//
|
|
136
129
|
|
|
137
|
-
|
|
138
130
|
function parseSpace(space) {
|
|
139
131
|
return "".concat(parseSpaceProp(space), "px");
|
|
140
|
-
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
//
|
|
141
135
|
// Margins
|
|
142
136
|
//
|
|
143
137
|
|
|
144
|
-
|
|
145
138
|
function parseMargin(input) {
|
|
146
139
|
if (input === 'auto') return input;
|
|
147
140
|
var prefix = '';
|
|
148
|
-
|
|
149
141
|
if (typeof input == 'string' && input.startsWith('-')) {
|
|
150
142
|
prefix = '-';
|
|
151
143
|
input = input.slice(1);
|
|
152
144
|
}
|
|
153
|
-
|
|
154
145
|
return prefix + parseSpace(input);
|
|
155
|
-
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
//
|
|
156
149
|
// Borders
|
|
157
150
|
//
|
|
158
151
|
|
|
159
|
-
|
|
160
152
|
var normalizeBorderRadius = /*#__PURE__*/createRuleNormalizer({
|
|
161
153
|
none: 0,
|
|
162
154
|
small: 4,
|
|
@@ -167,7 +159,9 @@ var normalizeBorderWidth = /*#__PURE__*/createRuleNormalizer({
|
|
|
167
159
|
small: 1,
|
|
168
160
|
medium: 2,
|
|
169
161
|
large: 4
|
|
170
|
-
});
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
//
|
|
171
165
|
// Rules
|
|
172
166
|
//
|
|
173
167
|
|
|
@@ -216,25 +210,22 @@ var normalizers = {
|
|
|
216
210
|
bottom: undefined,
|
|
217
211
|
position: undefined
|
|
218
212
|
};
|
|
219
|
-
|
|
220
213
|
function injectRule(styles, key, breakpoint, value, normalizer) {
|
|
221
214
|
if (normalizer != null) value = normalizer(value);
|
|
222
|
-
|
|
223
215
|
if (value != null) {
|
|
224
216
|
var rules = styles[breakpoint];
|
|
225
|
-
|
|
226
217
|
if (typeof rules != 'object') {
|
|
227
218
|
rules = {};
|
|
228
219
|
styles[breakpoint] = rules;
|
|
229
220
|
}
|
|
230
|
-
|
|
231
221
|
rules[key] = String(value);
|
|
232
222
|
}
|
|
233
|
-
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
//
|
|
234
226
|
// Box
|
|
235
227
|
//
|
|
236
228
|
|
|
237
|
-
|
|
238
229
|
var Box = /*#__PURE__*/styled.div.withConfig({
|
|
239
230
|
displayName: "Box",
|
|
240
231
|
componentId: "SD__sc-1bc600y-0"
|
|
@@ -251,12 +242,10 @@ var Box = /*#__PURE__*/styled.div.withConfig({
|
|
|
251
242
|
borderWidth: 0,
|
|
252
243
|
borderStyle: 'solid'
|
|
253
244
|
};
|
|
254
|
-
|
|
255
245
|
for (var k in props) {
|
|
256
246
|
if (Object.prototype.hasOwnProperty.call(props, k) && k in normalizers) {
|
|
257
247
|
var key = k;
|
|
258
248
|
var prop = props[key];
|
|
259
|
-
|
|
260
249
|
if (prop != null) {
|
|
261
250
|
var [mobile, tablet, desktop] = parseResponsiveProp(prop);
|
|
262
251
|
var normalizer = normalizers[key];
|
|
@@ -266,7 +255,6 @@ var Box = /*#__PURE__*/styled.div.withConfig({
|
|
|
266
255
|
}
|
|
267
256
|
}
|
|
268
257
|
}
|
|
269
|
-
|
|
270
258
|
return styles;
|
|
271
259
|
});
|
|
272
260
|
|
|
@@ -277,15 +265,14 @@ var ButtonRoot = /*#__PURE__*/styled(ButtonBase).withConfig({
|
|
|
277
265
|
})(["padding:12px 32px;border-width:1px;border-radius:4px;border-style:solid;border-color:", ";color:", ";background-color:", ";& svg{color:inherit;font-size:24px;}&[data-full-width='true']{width:100%;}&[data-disabled='true']{color:", ";border-color:", ";}&[data-variant='success']{&:hover{color:", ";box-shadow:0 0 0 2px ", ";border-color:", ";}&[data-active='true']{color:", ";border-color:", ";background-color:", ";}}&[data-variant='danger']{&:hover{color:", ";box-shadow:0 0 0 2px ", ";border-color:", ";}&[data-active='true']{color:", ";border-color:", ";background-color:", ";}}"], Color.Silver500, Color.Dark100, Color.White, Color.Silver500, Color.Silver400, Color.Green300, Color.Green100, Color.Green300, Color.Green300, Color.Green300, Color.Green50, Color.Red300, Color.Red100, Color.Red300, Color.Red300, Color.Red300, Color.Red50);
|
|
278
266
|
var ButtonArea = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
279
267
|
var {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
268
|
+
icon,
|
|
269
|
+
children,
|
|
270
|
+
variant,
|
|
271
|
+
active,
|
|
272
|
+
disabled,
|
|
273
|
+
fullWidth
|
|
274
|
+
} = _ref,
|
|
275
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
289
276
|
return /*#__PURE__*/jsx(ButtonRoot, _objectSpread(_objectSpread({
|
|
290
277
|
ref: ref,
|
|
291
278
|
disabled: disabled,
|
|
@@ -308,9 +295,8 @@ var ButtonArea = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
308
295
|
if (process.env.NODE_ENV !== "production") ButtonArea.displayName = "ButtonArea";
|
|
309
296
|
|
|
310
297
|
var _excluded$2 = ["children", "endIcon", "startIcon", "tabIndex", "active", "pending", "disabled", "size", "fullWidth", "variant"],
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
298
|
+
_excluded2$1 = ["type"],
|
|
299
|
+
_excluded3 = ["href", "target"];
|
|
314
300
|
function createButtonVariables(size, _ref) {
|
|
315
301
|
var {
|
|
316
302
|
fontSize = size === 'large' ? 16 : 14,
|
|
@@ -357,7 +343,6 @@ function createButtonVariables(size, _ref) {
|
|
|
357
343
|
iconColor
|
|
358
344
|
};
|
|
359
345
|
}
|
|
360
|
-
|
|
361
346
|
function getDefaultVariables(size) {
|
|
362
347
|
return createButtonVariables(size, {
|
|
363
348
|
textColor: Color.White,
|
|
@@ -369,11 +354,9 @@ function getDefaultVariables(size) {
|
|
|
369
354
|
backgroundColorDisabled: Color.Blue30
|
|
370
355
|
});
|
|
371
356
|
}
|
|
372
|
-
|
|
373
357
|
function getPrimaryVariables(size) {
|
|
374
358
|
return getDefaultVariables(size);
|
|
375
359
|
}
|
|
376
|
-
|
|
377
360
|
function getNeutralVariables(size) {
|
|
378
361
|
return createButtonVariables(size, {
|
|
379
362
|
textColor: Color.Dark500,
|
|
@@ -388,7 +371,6 @@ function getNeutralVariables(size) {
|
|
|
388
371
|
iconColor: Color.Dark100
|
|
389
372
|
});
|
|
390
373
|
}
|
|
391
|
-
|
|
392
374
|
function getCriticalVariables(size) {
|
|
393
375
|
return createButtonVariables(size, {
|
|
394
376
|
textColor: Color.Red500,
|
|
@@ -402,7 +384,6 @@ function getCriticalVariables(size) {
|
|
|
402
384
|
backgroundColorDisabled: Color.Red50
|
|
403
385
|
});
|
|
404
386
|
}
|
|
405
|
-
|
|
406
387
|
function getTextVariables(size) {
|
|
407
388
|
return createButtonVariables(size, {
|
|
408
389
|
textColor: Color.Blue500,
|
|
@@ -413,7 +394,6 @@ function getTextVariables(size) {
|
|
|
413
394
|
textColorDisabled: Color.Blue30
|
|
414
395
|
});
|
|
415
396
|
}
|
|
416
|
-
|
|
417
397
|
function getInvertedVariables(size) {
|
|
418
398
|
return createButtonVariables(size, {
|
|
419
399
|
textColor: Color.White,
|
|
@@ -426,7 +406,6 @@ function getInvertedVariables(size) {
|
|
|
426
406
|
backgroundColorDisabled: Color.White08
|
|
427
407
|
});
|
|
428
408
|
}
|
|
429
|
-
|
|
430
409
|
function getSuccessVariables(size) {
|
|
431
410
|
return createButtonVariables(size, {
|
|
432
411
|
textColor: Color.White,
|
|
@@ -438,7 +417,6 @@ function getSuccessVariables(size) {
|
|
|
438
417
|
backgroundColorDisabled: Color.Green30
|
|
439
418
|
});
|
|
440
419
|
}
|
|
441
|
-
|
|
442
420
|
var ButtonRoot$1 = /*#__PURE__*/styled.button.withConfig({
|
|
443
421
|
displayName: "Button__ButtonRoot",
|
|
444
422
|
componentId: "SD__sc-1pwdpe3-0"
|
|
@@ -468,22 +446,20 @@ var ButtonPendingIndicator = /*#__PURE__*/styled.span.withConfig({
|
|
|
468
446
|
displayName: "Button__ButtonPendingIndicator",
|
|
469
447
|
componentId: "SD__sc-1pwdpe3-4"
|
|
470
448
|
})(["left:50%;display:flex;position:absolute;visibility:visible;transform:translate(-50%);"]);
|
|
471
|
-
|
|
472
449
|
function useButtonProps(_ref3) {
|
|
473
450
|
var {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
451
|
+
children,
|
|
452
|
+
endIcon,
|
|
453
|
+
startIcon,
|
|
454
|
+
tabIndex: tabIndexProp = 0,
|
|
455
|
+
active = false,
|
|
456
|
+
pending = false,
|
|
457
|
+
disabled: disabledProp = false,
|
|
458
|
+
size = 'medium',
|
|
459
|
+
fullWidth = false,
|
|
460
|
+
variant = 'default'
|
|
461
|
+
} = _ref3,
|
|
462
|
+
props = _objectWithoutProperties(_ref3, _excluded$2);
|
|
487
463
|
var disabled = pending || disabledProp;
|
|
488
464
|
var tabIndex = disabled ? -1 : tabIndexProp;
|
|
489
465
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -509,13 +485,11 @@ function useButtonProps(_ref3) {
|
|
|
509
485
|
})
|
|
510
486
|
});
|
|
511
487
|
}
|
|
512
|
-
|
|
513
488
|
var Button = /*#__PURE__*/forwardRef((_ref4, ref) => {
|
|
514
489
|
var {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
490
|
+
type = 'button'
|
|
491
|
+
} = _ref4,
|
|
492
|
+
props = _objectWithoutProperties(_ref4, _excluded2$1);
|
|
519
493
|
var buttonProps = useButtonProps(props);
|
|
520
494
|
return /*#__PURE__*/jsx(ButtonRoot$1, _objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
521
495
|
ref: ref,
|
|
@@ -525,11 +499,10 @@ var Button = /*#__PURE__*/forwardRef((_ref4, ref) => {
|
|
|
525
499
|
if (process.env.NODE_ENV !== "production") Button.displayName = "Button";
|
|
526
500
|
var AnchorButton = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
527
501
|
var {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
502
|
+
href,
|
|
503
|
+
target
|
|
504
|
+
} = _ref5,
|
|
505
|
+
props = _objectWithoutProperties(_ref5, _excluded3);
|
|
533
506
|
var buttonProps = useButtonProps(props);
|
|
534
507
|
var rel = target === '_blank' ? 'noopener noreferrer' : undefined;
|
|
535
508
|
return /*#__PURE__*/jsx(ButtonRoot$1, _objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
@@ -551,7 +524,6 @@ var ChatContainer = /*#__PURE__*/styled('div').withConfig({
|
|
|
551
524
|
} = _ref;
|
|
552
525
|
return "\n display: flex;\n flex-direction: column-reverse;\n overflow: auto;\n justify-content: ".concat(isEmpty ? 'center' : 'end', ";\n width: 100%;\n height: 100%;\n min-width: 300px;\n max-width: 560px;\n min-height: 368px;\n max-height: 696px;\n padding: 16px;\n box-sizing: border-box;\n");
|
|
553
526
|
});
|
|
554
|
-
|
|
555
527
|
function emptyPlaceholder(text) {
|
|
556
528
|
return /*#__PURE__*/jsx(Typography, {
|
|
557
529
|
color: "textSecondary",
|
|
@@ -559,7 +531,6 @@ function emptyPlaceholder(text) {
|
|
|
559
531
|
children: text
|
|
560
532
|
});
|
|
561
533
|
}
|
|
562
|
-
|
|
563
534
|
var Chat = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
564
535
|
var {
|
|
565
536
|
children,
|
|
@@ -628,10 +599,9 @@ ChatMessage.displayName = 'ChatMessage';
|
|
|
628
599
|
var _excluded$3 = ["fullViewportHeight"];
|
|
629
600
|
var Container = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
630
601
|
var {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
602
|
+
fullViewportHeight
|
|
603
|
+
} = _ref,
|
|
604
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
635
605
|
var nodeRef = useRef(null);
|
|
636
606
|
useLayoutEffect(() => {
|
|
637
607
|
if (!fullViewportHeight) {
|
|
@@ -639,10 +609,8 @@ var Container = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
639
609
|
nodeRef.current.style.removeProperty('height');
|
|
640
610
|
nodeRef.current.style.removeProperty('--vh');
|
|
641
611
|
}
|
|
642
|
-
|
|
643
612
|
return;
|
|
644
613
|
}
|
|
645
|
-
|
|
646
614
|
function updateHeight() {
|
|
647
615
|
if (nodeRef.current) {
|
|
648
616
|
// https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
|
|
@@ -650,7 +618,6 @@ var Container = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
650
618
|
nodeRef.current.style.setProperty('--vh', "".concat(window.innerHeight * 0.01, "px"));
|
|
651
619
|
}
|
|
652
620
|
}
|
|
653
|
-
|
|
654
621
|
updateHeight();
|
|
655
622
|
window.addEventListener('resize', updateHeight);
|
|
656
623
|
return () => {
|
|
@@ -668,14 +635,12 @@ function mergeStyles(styles) {
|
|
|
668
635
|
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
669
636
|
sources[_key - 1] = arguments[_key];
|
|
670
637
|
}
|
|
671
|
-
|
|
672
638
|
for (var source of sources) {
|
|
673
639
|
if (source) {
|
|
674
640
|
for (var key in source) {
|
|
675
641
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
676
642
|
var stylesValue = styles[key];
|
|
677
643
|
var sourceValue = source[key];
|
|
678
|
-
|
|
679
644
|
if (typeof stylesValue == 'object' && typeof sourceValue == 'object') {
|
|
680
645
|
mergeStyles(stylesValue, sourceValue);
|
|
681
646
|
} else {
|
|
@@ -685,7 +650,6 @@ function mergeStyles(styles) {
|
|
|
685
650
|
}
|
|
686
651
|
}
|
|
687
652
|
}
|
|
688
|
-
|
|
689
653
|
return styles;
|
|
690
654
|
}
|
|
691
655
|
|
|
@@ -714,36 +678,27 @@ var VARIANT_TYPE_MAPPING = {
|
|
|
714
678
|
'body-semibold': 'span',
|
|
715
679
|
caption: 'span'
|
|
716
680
|
};
|
|
717
|
-
|
|
718
681
|
function variantMixin(_ref, variant) {
|
|
719
682
|
var {
|
|
720
683
|
typography,
|
|
721
684
|
breakpoints
|
|
722
685
|
} = _ref;
|
|
723
|
-
|
|
724
686
|
switch (variant) {
|
|
725
687
|
case 'heading-1':
|
|
726
688
|
return typography.h1;
|
|
727
|
-
|
|
728
689
|
case 'heading-2':
|
|
729
690
|
return typography.h2;
|
|
730
|
-
|
|
731
691
|
case 'heading-3':
|
|
732
692
|
return typography.h3;
|
|
733
|
-
|
|
734
693
|
case 'heading-4':
|
|
735
694
|
return typography.h4;
|
|
736
|
-
|
|
737
695
|
case 'heading-5':
|
|
738
696
|
return typography.h5;
|
|
739
|
-
|
|
740
697
|
case 'heading-6':
|
|
741
698
|
return typography.h6;
|
|
742
|
-
|
|
743
699
|
case 'body':
|
|
744
700
|
default:
|
|
745
701
|
return typography.body2;
|
|
746
|
-
|
|
747
702
|
case 'body-block':
|
|
748
703
|
{
|
|
749
704
|
return mergeStyles({}, typography.body2, {
|
|
@@ -753,19 +708,15 @@ function variantMixin(_ref, variant) {
|
|
|
753
708
|
}
|
|
754
709
|
});
|
|
755
710
|
}
|
|
756
|
-
|
|
757
711
|
case 'body-semibold':
|
|
758
712
|
return typography.body1;
|
|
759
|
-
|
|
760
713
|
case 'caption':
|
|
761
714
|
return typography.caption;
|
|
762
715
|
}
|
|
763
716
|
}
|
|
764
|
-
|
|
765
717
|
function textBoxMixin(noWrap, align, color, display, wrapOverflow) {
|
|
766
718
|
return css(["text-align:", ";color:", ";display:", ";overflow:", ";white-space:", ";overflow-wrap:", ";"], align, normalizeTextColor(color), display === 'initial' && (noWrap || align !== 'left') ? 'block' : display, noWrap ? 'hidden' : 'visible', noWrap ? 'nowrap' : 'normal', wrapOverflow ? 'break-word' : 'normal');
|
|
767
719
|
}
|
|
768
|
-
|
|
769
720
|
var TextBoxRoot = /*#__PURE__*/styled.span.withConfig({
|
|
770
721
|
displayName: "TextBox__TextBoxRoot",
|
|
771
722
|
componentId: "SD__sc-9mywck-0"
|
|
@@ -783,16 +734,15 @@ var TextBoxRoot = /*#__PURE__*/styled.span.withConfig({
|
|
|
783
734
|
});
|
|
784
735
|
var TextBox = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
785
736
|
var {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
737
|
+
variant: $variant = 'body',
|
|
738
|
+
as = VARIANT_TYPE_MAPPING[$variant],
|
|
739
|
+
align = 'left',
|
|
740
|
+
color = 'primary',
|
|
741
|
+
display = 'initial',
|
|
742
|
+
noWrap = false,
|
|
743
|
+
wrapOverflow = false
|
|
744
|
+
} = _ref3,
|
|
745
|
+
props = _objectWithoutProperties(_ref3, _excluded$4);
|
|
796
746
|
var $align = parseResponsiveProp(align);
|
|
797
747
|
var $color = parseResponsiveProp(color);
|
|
798
748
|
var $noWrap = parseResponsiveProp(noWrap);
|
|
@@ -814,7 +764,6 @@ if (process.env.NODE_ENV !== "production") TextBox.displayName = "TextBox";
|
|
|
814
764
|
function descriptionItemIconMixin(size) {
|
|
815
765
|
return css(["width:", "px;height:", "px;& > .MuiSvgIcon-root{font-size:", "px;}"], size, size + 4, size);
|
|
816
766
|
}
|
|
817
|
-
|
|
818
767
|
var DescriptionItemIcon = /*#__PURE__*/styled.div.withConfig({
|
|
819
768
|
displayName: "DescriptionItem__DescriptionItemIcon",
|
|
820
769
|
componentId: "SD__sc-1906hic-0"
|
|
@@ -924,7 +873,6 @@ var StyledCardButton = /*#__PURE__*/styled(CardButton).withConfig({
|
|
|
924
873
|
backgroundColor: status === 'active' ? Color.Blue50 : undefined
|
|
925
874
|
};
|
|
926
875
|
});
|
|
927
|
-
|
|
928
876
|
function UploadRejection(_ref2) {
|
|
929
877
|
var {
|
|
930
878
|
maxSize,
|
|
@@ -942,36 +890,34 @@ function UploadRejection(_ref2) {
|
|
|
942
890
|
})]
|
|
943
891
|
});
|
|
944
892
|
}
|
|
945
|
-
|
|
946
893
|
var FileDropZone = /*#__PURE__*/forwardRef((props, ref) => {
|
|
947
894
|
var {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
}),
|
|
957
|
-
fallback = /*#__PURE__*/jsx(CardButton, {
|
|
958
|
-
ref: ref,
|
|
959
|
-
disabled: true,
|
|
960
|
-
startIcon: /*#__PURE__*/jsx(CircularProgress, {
|
|
961
|
-
size: "1em",
|
|
962
|
-
color: "inherit"
|
|
895
|
+
// CardButton
|
|
896
|
+
disabled = false,
|
|
897
|
+
children: _children = 'Upload Attachments',
|
|
898
|
+
hintText = 'or Drag & Drop files',
|
|
899
|
+
startIcon = /*#__PURE__*/jsx(SvgIcon, {
|
|
900
|
+
children: /*#__PURE__*/jsx("path", {
|
|
901
|
+
d: mdiUpload
|
|
902
|
+
})
|
|
963
903
|
}),
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
904
|
+
fallback = /*#__PURE__*/jsx(CardButton, {
|
|
905
|
+
ref: ref,
|
|
906
|
+
disabled: true,
|
|
907
|
+
startIcon: /*#__PURE__*/jsx(CircularProgress, {
|
|
908
|
+
size: "1em",
|
|
909
|
+
color: "inherit"
|
|
910
|
+
}),
|
|
911
|
+
children: "Loading dependencies\u2026"
|
|
912
|
+
}),
|
|
913
|
+
// Dropzone
|
|
914
|
+
accept,
|
|
915
|
+
maxSize = Infinity,
|
|
916
|
+
maxFiles = Infinity,
|
|
917
|
+
onDropRejected: _onDropRejected,
|
|
918
|
+
onDropAccepted: _onDropAccepted
|
|
919
|
+
} = props,
|
|
920
|
+
dropzoneProps = _objectWithoutProperties(props, _excluded$5);
|
|
975
921
|
return /*#__PURE__*/jsx(Suspense, {
|
|
976
922
|
fallback: fallback,
|
|
977
923
|
children: /*#__PURE__*/jsx(Dropzone, _objectSpread(_objectSpread({}, dropzoneProps), {}, {
|
|
@@ -1039,13 +985,11 @@ var TextBoxIcon = /*#__PURE__*/memo(props => /*#__PURE__*/jsx(SvgIcon, _objectSp
|
|
|
1039
985
|
})));
|
|
1040
986
|
var PDF_FILE_PATTERN = /\.pdf$/;
|
|
1041
987
|
var IMAGE_FILE_PATTERN = /\.(gif|png|jpg|jpeg)$/;
|
|
1042
|
-
|
|
1043
988
|
function getFileType(name) {
|
|
1044
989
|
if (PDF_FILE_PATTERN.exec(name)) return 'pdf';
|
|
1045
990
|
if (IMAGE_FILE_PATTERN.exec(name)) return 'image';
|
|
1046
991
|
return 'unknown';
|
|
1047
992
|
}
|
|
1048
|
-
|
|
1049
993
|
var FileListItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
1050
994
|
var {
|
|
1051
995
|
url,
|
|
@@ -1141,15 +1085,14 @@ var FileListItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
1141
1085
|
if (process.env.NODE_ENV !== "production") FileListItem.displayName = "FileListItem";
|
|
1142
1086
|
|
|
1143
1087
|
var _excluded$6 = ["color", "target", "rel"],
|
|
1144
|
-
|
|
1088
|
+
_excluded2$2 = ["children", "linkComponent"];
|
|
1145
1089
|
var DefaultLinkComponent = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
1146
1090
|
var {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1091
|
+
color,
|
|
1092
|
+
target = '_blank',
|
|
1093
|
+
rel = 'noreferrer noopener'
|
|
1094
|
+
} = _ref,
|
|
1095
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1153
1096
|
return /*#__PURE__*/jsx(Link, _objectSpread(_objectSpread({}, props), {}, {
|
|
1154
1097
|
ref: ref,
|
|
1155
1098
|
rel: rel,
|
|
@@ -1160,15 +1103,13 @@ if (process.env.NODE_ENV !== "production") DefaultLinkComponent.displayName = "D
|
|
|
1160
1103
|
DefaultLinkComponent.displayName = 'DefaultLinkComponent';
|
|
1161
1104
|
function LinkedText(_ref2) {
|
|
1162
1105
|
var {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1106
|
+
children,
|
|
1107
|
+
linkComponent = DefaultLinkComponent
|
|
1108
|
+
} = _ref2,
|
|
1109
|
+
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
1168
1110
|
if (!children) {
|
|
1169
1111
|
return null;
|
|
1170
1112
|
}
|
|
1171
|
-
|
|
1172
1113
|
return /*#__PURE__*/jsx(Anchorme, _objectSpread(_objectSpread({}, props), {}, {
|
|
1173
1114
|
linkComponent: linkComponent,
|
|
1174
1115
|
children: children
|
|
@@ -1238,11 +1179,10 @@ function NavbarBottomBar(_ref) {
|
|
|
1238
1179
|
},
|
|
1239
1180
|
children: [items.map(_ref2 => {
|
|
1240
1181
|
var {
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1182
|
+
active,
|
|
1183
|
+
hasBadge
|
|
1184
|
+
} = _ref2,
|
|
1185
|
+
item = _objectWithoutProperties(_ref2, _excluded$7);
|
|
1246
1186
|
return /*#__PURE__*/createElement(StyledBottomNavigationAction, _objectSpread(_objectSpread({}, item), {}, {
|
|
1247
1187
|
key: item.value,
|
|
1248
1188
|
icon: hasBadge ? /*#__PURE__*/jsxs(IconWrapper, {
|
|
@@ -1342,8 +1282,9 @@ function NavbarAccordion(_ref) {
|
|
|
1342
1282
|
setDrawerOpen,
|
|
1343
1283
|
isNavbarExpanded
|
|
1344
1284
|
} = useNavbarContext();
|
|
1345
|
-
var [isExpanded, setExpanded] = useState(true);
|
|
1285
|
+
var [isExpanded, setExpanded] = useState(true);
|
|
1346
1286
|
|
|
1287
|
+
// sync accordion state with Desktop menu state
|
|
1347
1288
|
useEffect(() => {
|
|
1348
1289
|
setExpanded(isNavbarExpanded);
|
|
1349
1290
|
}, [isNavbarExpanded]);
|
|
@@ -1355,7 +1296,6 @@ function NavbarAccordion(_ref) {
|
|
|
1355
1296
|
expanded: isExpanded,
|
|
1356
1297
|
onClick: event => {
|
|
1357
1298
|
_onClick === null || _onClick === void 0 ? void 0 : _onClick(event);
|
|
1358
|
-
|
|
1359
1299
|
if (isNavbarExpanded) {
|
|
1360
1300
|
setExpanded(!isExpanded);
|
|
1361
1301
|
}
|
|
@@ -1384,10 +1324,8 @@ function NavbarAccordion(_ref) {
|
|
|
1384
1324
|
gutter: prev && prev.groupKey !== item.groupKey,
|
|
1385
1325
|
onClick: event => {
|
|
1386
1326
|
var _item$onClick;
|
|
1387
|
-
|
|
1388
1327
|
event.stopPropagation();
|
|
1389
1328
|
(_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
|
|
1390
|
-
|
|
1391
1329
|
if (!event.isDefaultPrevented()) {
|
|
1392
1330
|
setDrawerOpen(false);
|
|
1393
1331
|
}
|
|
@@ -1494,7 +1432,6 @@ function NavbarList(_ref5) {
|
|
|
1494
1432
|
children: filteredItems.map(item => {
|
|
1495
1433
|
var index = filteredItems.indexOf(item);
|
|
1496
1434
|
var prev = filteredItems[index - 1];
|
|
1497
|
-
|
|
1498
1435
|
if ('items' in item) {
|
|
1499
1436
|
return /*#__PURE__*/createElement(NavbarAccordion, _objectSpread(_objectSpread({}, item), {}, {
|
|
1500
1437
|
key: item.key,
|
|
@@ -1502,15 +1439,12 @@ function NavbarList(_ref5) {
|
|
|
1502
1439
|
onClick: item.onClick
|
|
1503
1440
|
}));
|
|
1504
1441
|
}
|
|
1505
|
-
|
|
1506
1442
|
return /*#__PURE__*/createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
|
|
1507
1443
|
key: item.key,
|
|
1508
1444
|
gutter: prev && prev.groupKey !== item.groupKey,
|
|
1509
1445
|
onClick: event => {
|
|
1510
1446
|
var _item$onClick;
|
|
1511
|
-
|
|
1512
1447
|
(_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
|
|
1513
|
-
|
|
1514
1448
|
if (!event.isDefaultPrevented()) {
|
|
1515
1449
|
setDrawerOpen(false);
|
|
1516
1450
|
}
|
|
@@ -1605,22 +1539,19 @@ var StyledTypography = /*#__PURE__*/styled(Typography).withConfig({
|
|
|
1605
1539
|
})(["color:", ";text-overflow:ellipsis;white-space:nowrap;overflow:hidden;&:hover{color:", ";}"], Color.Silver500, Color.White);
|
|
1606
1540
|
function NavbarAvatar(_ref) {
|
|
1607
1541
|
var {
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1542
|
+
title,
|
|
1543
|
+
subtitle,
|
|
1544
|
+
children
|
|
1545
|
+
} = _ref,
|
|
1546
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
1614
1547
|
var {
|
|
1615
1548
|
isNavbarExpanded
|
|
1616
1549
|
} = useNavbarContext();
|
|
1617
|
-
|
|
1618
1550
|
if (!isNavbarExpanded) {
|
|
1619
1551
|
return /*#__PURE__*/jsx(Avatar, _objectSpread(_objectSpread({}, props), {}, {
|
|
1620
1552
|
children: children
|
|
1621
1553
|
}));
|
|
1622
1554
|
}
|
|
1623
|
-
|
|
1624
1555
|
return /*#__PURE__*/jsxs(Columns, {
|
|
1625
1556
|
space: "xsmall",
|
|
1626
1557
|
align: "center",
|
|
@@ -1670,16 +1601,13 @@ function NavbarMenu(_ref2) {
|
|
|
1670
1601
|
setDrawerOpen
|
|
1671
1602
|
} = useNavbarContext();
|
|
1672
1603
|
var [anchor, setAnchor] = useState(null);
|
|
1673
|
-
|
|
1674
1604
|
function showProfileMenu(event) {
|
|
1675
1605
|
setAnchor(event.currentTarget);
|
|
1676
1606
|
}
|
|
1677
|
-
|
|
1678
1607
|
function hideProfileMenu() {
|
|
1679
1608
|
setAnchor(null);
|
|
1680
1609
|
setDrawerOpen(false);
|
|
1681
1610
|
}
|
|
1682
|
-
|
|
1683
1611
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
1684
1612
|
children: [/*#__PURE__*/jsx(Wrapper$1, {
|
|
1685
1613
|
onClick: showProfileMenu,
|
|
@@ -1775,11 +1703,9 @@ if (process.env.NODE_ENV !== "production") Sidebar.displayName = "Sidebar";
|
|
|
1775
1703
|
var Context = /*#__PURE__*/createContext(null);
|
|
1776
1704
|
function useSidebarContext() {
|
|
1777
1705
|
var context = useContext(Context);
|
|
1778
|
-
|
|
1779
1706
|
if (!context) {
|
|
1780
1707
|
throw new Error('SidebarContext is used outside Provider');
|
|
1781
1708
|
}
|
|
1782
|
-
|
|
1783
1709
|
return context;
|
|
1784
1710
|
}
|
|
1785
1711
|
var SidebarContainerSidebar = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -1830,27 +1756,23 @@ if (process.env.NODE_ENV !== "production") SidebarContainer.displayName = "Sideb
|
|
|
1830
1756
|
var _excluded$9 = ["onClick", "children"];
|
|
1831
1757
|
function SidebarBackButton(_ref) {
|
|
1832
1758
|
var {
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1759
|
+
onClick: _onClick,
|
|
1760
|
+
children = /*#__PURE__*/jsx(ArrowBack, {
|
|
1761
|
+
fontSize: "small"
|
|
1762
|
+
})
|
|
1763
|
+
} = _ref,
|
|
1764
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
1840
1765
|
var isCollapsed = useCollapseBreakpoint('sm');
|
|
1841
1766
|
var {
|
|
1842
1767
|
openSidebar
|
|
1843
1768
|
} = useSidebarContext();
|
|
1844
|
-
|
|
1845
1769
|
if (!isCollapsed) {
|
|
1846
1770
|
return null;
|
|
1847
1771
|
}
|
|
1848
|
-
|
|
1849
1772
|
return /*#__PURE__*/jsx(IconButton, _objectSpread(_objectSpread({}, props), {}, {
|
|
1850
1773
|
size: "small",
|
|
1851
1774
|
onClick: event => {
|
|
1852
1775
|
_onClick === null || _onClick === void 0 ? void 0 : _onClick(event);
|
|
1853
|
-
|
|
1854
1776
|
if (!event.isDefaultPrevented()) {
|
|
1855
1777
|
openSidebar();
|
|
1856
1778
|
}
|
|
@@ -2033,7 +1955,6 @@ var SidebarMenuItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
2033
1955
|
});
|
|
2034
1956
|
useLayoutEffect(() => {
|
|
2035
1957
|
var rootNode = rootRef.current;
|
|
2036
|
-
|
|
2037
1958
|
if (rootNode) {
|
|
2038
1959
|
if (isHoverSupported) {
|
|
2039
1960
|
rootNode.addEventListener('mouseenter', () => {
|
|
@@ -2056,7 +1977,6 @@ var SidebarMenuItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
2056
1977
|
"aria-current": selected,
|
|
2057
1978
|
onClick: event => {
|
|
2058
1979
|
_onClick === null || _onClick === void 0 ? void 0 : _onClick(event);
|
|
2059
|
-
|
|
2060
1980
|
if (!event.isDefaultPrevented() && openContentOnClick) {
|
|
2061
1981
|
openSidebarContent();
|
|
2062
1982
|
}
|
|
@@ -2145,7 +2065,6 @@ if (process.env.NODE_ENV !== "production") SidebarMenuItemAction.displayName = "
|
|
|
2145
2065
|
function stopPropagation(event) {
|
|
2146
2066
|
event.stopPropagation();
|
|
2147
2067
|
}
|
|
2148
|
-
|
|
2149
2068
|
var SidebarMenuItemAvatarCheckbox = /*#__PURE__*/styled.div.withConfig({
|
|
2150
2069
|
displayName: "SidebarMenuItemAvatar__SidebarMenuItemAvatarCheckbox",
|
|
2151
2070
|
componentId: "SD__sc-17mkvc7-0"
|
|
@@ -2166,7 +2085,6 @@ var SidebarMenuItemAvatar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
2166
2085
|
var last = matches.pop() || '';
|
|
2167
2086
|
return (first + last).toUpperCase();
|
|
2168
2087
|
}, [children]);
|
|
2169
|
-
|
|
2170
2088
|
if (value === true || hovered && value != null) {
|
|
2171
2089
|
return /*#__PURE__*/jsx(SidebarMenuItemAvatarCheckbox, {
|
|
2172
2090
|
children: /*#__PURE__*/jsx(Checkbox, {
|
|
@@ -2182,7 +2100,6 @@ var SidebarMenuItemAvatar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
2182
2100
|
})
|
|
2183
2101
|
});
|
|
2184
2102
|
}
|
|
2185
|
-
|
|
2186
2103
|
return /*#__PURE__*/jsx(Avatar, {
|
|
2187
2104
|
ref: ref,
|
|
2188
2105
|
"aria-hidden": true,
|