@superdispatch/ui-lab 0.11.0 → 0.15.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 +77 -20
- package/dist-node/index.js.map +1 -1
- package/dist-src/banner/Banner.js +61 -0
- package/dist-src/button/Button.js +2 -3
- package/dist-src/button-area/ButtonArea.js +1 -1
- package/dist-src/description-item/DescriptionItem.js +1 -1
- package/dist-src/file-list-item/FileListItem.js +2 -2
- package/dist-src/index.js +1 -0
- package/dist-src/sidebar/SidebarMenuItem.js +1 -1
- package/dist-src/sidebar/SidebarSubheader.js +2 -1
- package/dist-src/text-box/TextBox.js +3 -2
- package/dist-types/index.d.ts +12 -2
- package/dist-web/index.js +80 -24
- package/dist-web/index.js.map +1 -1
- package/package.json +3 -3
package/dist-node/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var styled__default = _interopDefault(styled);
|
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
var _objectSpread = _interopDefault(require('@babel/runtime/helpers/objectSpread2'));
|
|
15
15
|
var _objectWithoutProperties = _interopDefault(require('@babel/runtime/helpers/objectWithoutProperties'));
|
|
16
|
+
var reactTransitionGroup = require('react-transition-group');
|
|
16
17
|
var core = require('@material-ui/core');
|
|
17
18
|
var js = require('@mdi/js');
|
|
18
19
|
var Dropzone = _interopDefault(require('react-dropzone'));
|
|
@@ -54,6 +55,60 @@ var Alert = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
|
54
55
|
});
|
|
55
56
|
if (process.env.NODE_ENV !== "production") Alert.displayName = "Alert";
|
|
56
57
|
|
|
58
|
+
var _excluded = ["children"],
|
|
59
|
+
_excluded2 = ["in"];
|
|
60
|
+
|
|
61
|
+
function enterMixin(border) {
|
|
62
|
+
return styled.css(["min-height:56px;color:", ";background-color:", ";border-", ":1px #dfe3e8 solid;"], ui.Color.Dark500, ui.Color.White, border);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function enterAnimation(border) {
|
|
66
|
+
return styled.keyframes(["0%{min-height:0;color:", ";background-color:", ";}50%{min-height:56px;color:", ";background-color:", ";}70%{min-height:56px;color:", ";background-color:", ";}100%{", "}"], ui.Color.White, ui.Color.Dark500, ui.Color.White, ui.Color.Dark500, ui.Color.White, ui.Color.Dark500, enterMixin(border));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var CustomTransition = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
70
|
+
var {
|
|
71
|
+
children
|
|
72
|
+
} = _ref,
|
|
73
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
74
|
+
|
|
75
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, _objectSpread(_objectSpread({}, props), {}, {
|
|
76
|
+
ref: ref,
|
|
77
|
+
timeout: 3000,
|
|
78
|
+
classNames: props.className,
|
|
79
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
80
|
+
children: children
|
|
81
|
+
})
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
if (process.env.NODE_ENV !== "production") CustomTransition.displayName = "CustomTransition";
|
|
85
|
+
var BannerContent = /*#__PURE__*/styled__default(CustomTransition).withConfig({
|
|
86
|
+
displayName: "Banner__BannerContent",
|
|
87
|
+
componentId: "SD__sc-9kw31n-0"
|
|
88
|
+
})(_ref2 => {
|
|
89
|
+
var {
|
|
90
|
+
border = 'bottom'
|
|
91
|
+
} = _ref2;
|
|
92
|
+
return styled.css(["height:0;width:100%;overflow:hidden;display:flex;align-items:center;justify-content:center;color:", ";background-color:", ";&-enter-active{animation:", " 2s 1s forwards;}&-enter-done{", ";}&-exit{", ";}&-exit-active{min-height:0;transition:min-height 2s 1s;}"], ui.Color.White, ui.Color.White, enterAnimation(border), enterMixin(border), enterMixin(border));
|
|
93
|
+
});
|
|
94
|
+
var Banner = /*#__PURE__*/react.forwardRef((_ref3, ref) => {
|
|
95
|
+
var {
|
|
96
|
+
in: inProp
|
|
97
|
+
} = _ref3,
|
|
98
|
+
props = _objectWithoutProperties(_ref3, _excluded2);
|
|
99
|
+
|
|
100
|
+
var [isIn, setIn] = react.useState(false); // transition is not triggered on initial render with `in: true`
|
|
101
|
+
|
|
102
|
+
react.useEffect(() => {
|
|
103
|
+
setIn(!!inProp);
|
|
104
|
+
}, [inProp]);
|
|
105
|
+
return /*#__PURE__*/jsxRuntime.jsx(BannerContent, _objectSpread({
|
|
106
|
+
ref: ref,
|
|
107
|
+
in: isIn
|
|
108
|
+
}, props));
|
|
109
|
+
});
|
|
110
|
+
if (process.env.NODE_ENV !== "production") Banner.displayName = "Banner";
|
|
111
|
+
|
|
57
112
|
function createRuleNormalizer(rules) {
|
|
58
113
|
return input => {
|
|
59
114
|
if (typeof input == 'string') {
|
|
@@ -216,11 +271,11 @@ var Box = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
216
271
|
return styles;
|
|
217
272
|
});
|
|
218
273
|
|
|
219
|
-
var _excluded = ["icon", "children", "variant", "active", "disabled", "fullWidth"];
|
|
274
|
+
var _excluded$1 = ["icon", "children", "variant", "active", "disabled", "fullWidth"];
|
|
220
275
|
var ButtonRoot = /*#__PURE__*/styled__default(core.ButtonBase).withConfig({
|
|
221
276
|
displayName: "ButtonArea__ButtonRoot",
|
|
222
277
|
componentId: "SD__sc-1czum63-0"
|
|
223
|
-
})(["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:", ";}}"], ui.Color.Silver500, ui.Color.
|
|
278
|
+
})(["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:", ";}}"], ui.Color.Silver500, ui.Color.Dark100, ui.Color.White, ui.Color.Silver500, ui.Color.Silver400, ui.Color.Green300, ui.Color.Green100, ui.Color.Green300, ui.Color.Green300, ui.Color.Green300, ui.Color.Green50, ui.Color.Red300, ui.Color.Red100, ui.Color.Red300, ui.Color.Red300, ui.Color.Red300, ui.Color.Red50);
|
|
224
279
|
var ButtonArea = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
225
280
|
var {
|
|
226
281
|
icon,
|
|
@@ -230,7 +285,7 @@ var ButtonArea = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
|
230
285
|
disabled,
|
|
231
286
|
fullWidth
|
|
232
287
|
} = _ref,
|
|
233
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
288
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
234
289
|
|
|
235
290
|
return /*#__PURE__*/jsxRuntime.jsx(ButtonRoot, _objectSpread(_objectSpread({
|
|
236
291
|
ref: ref,
|
|
@@ -253,8 +308,8 @@ var ButtonArea = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
|
253
308
|
});
|
|
254
309
|
if (process.env.NODE_ENV !== "production") ButtonArea.displayName = "ButtonArea";
|
|
255
310
|
|
|
256
|
-
var _excluded$
|
|
257
|
-
_excluded2 = ["type"],
|
|
311
|
+
var _excluded$2 = ["children", "endIcon", "startIcon", "tabIndex", "active", "pending", "disabled", "size", "fullWidth", "variant"],
|
|
312
|
+
_excluded2$1 = ["type"],
|
|
258
313
|
_excluded3 = ["href", "target"];
|
|
259
314
|
|
|
260
315
|
function createButtonVariables(size, _ref) {
|
|
@@ -320,7 +375,7 @@ function getPrimaryVariables(size) {
|
|
|
320
375
|
|
|
321
376
|
function getNeutralVariables(size) {
|
|
322
377
|
return createButtonVariables(size, {
|
|
323
|
-
textColor: ui.Color.
|
|
378
|
+
textColor: ui.Color.Dark500,
|
|
324
379
|
borderColor: ui.Color.Silver500,
|
|
325
380
|
outlineColor: ui.Color.Blue100,
|
|
326
381
|
backgroundColor: ui.Color.White,
|
|
@@ -413,7 +468,7 @@ function useButtonProps(_ref3) {
|
|
|
413
468
|
fullWidth = false,
|
|
414
469
|
variant = 'default'
|
|
415
470
|
} = _ref3,
|
|
416
|
-
props = _objectWithoutProperties(_ref3, _excluded$
|
|
471
|
+
props = _objectWithoutProperties(_ref3, _excluded$2);
|
|
417
472
|
|
|
418
473
|
var disabled = pending || disabledProp;
|
|
419
474
|
var tabIndex = disabled ? -1 : tabIndexProp;
|
|
@@ -445,7 +500,7 @@ var Button = /*#__PURE__*/react.forwardRef((_ref4, ref) => {
|
|
|
445
500
|
var {
|
|
446
501
|
type = 'button'
|
|
447
502
|
} = _ref4,
|
|
448
|
-
props = _objectWithoutProperties(_ref4, _excluded2);
|
|
503
|
+
props = _objectWithoutProperties(_ref4, _excluded2$1);
|
|
449
504
|
|
|
450
505
|
var buttonProps = useButtonProps(props);
|
|
451
506
|
return /*#__PURE__*/jsxRuntime.jsx(ButtonRoot$1, _objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
@@ -464,8 +519,7 @@ var AnchorButton = /*#__PURE__*/react.forwardRef((_ref5, ref) => {
|
|
|
464
519
|
var buttonProps = useButtonProps(props);
|
|
465
520
|
var rel = target === '_blank' ? 'noopener noreferrer' : undefined;
|
|
466
521
|
return /*#__PURE__*/jsxRuntime.jsx(ButtonRoot$1, _objectSpread(_objectSpread({}, buttonProps), {}, {
|
|
467
|
-
as: "a"
|
|
468
|
-
,
|
|
522
|
+
as: "a",
|
|
469
523
|
ref: ref,
|
|
470
524
|
rel: rel,
|
|
471
525
|
href: href,
|
|
@@ -499,10 +553,11 @@ function mergeStyles(styles) {
|
|
|
499
553
|
return styles;
|
|
500
554
|
}
|
|
501
555
|
|
|
502
|
-
var _excluded$
|
|
556
|
+
var _excluded$3 = ["variant", "as", "align", "color", "display", "noWrap", "wrapOverflow"];
|
|
503
557
|
var normalizeTextColor = /*#__PURE__*/createRuleNormalizer({
|
|
504
|
-
|
|
505
|
-
|
|
558
|
+
inherit: 'inherit',
|
|
559
|
+
primary: ui.Color.Dark500,
|
|
560
|
+
secondary: ui.Color.Dark200,
|
|
506
561
|
white: ui.Color.White,
|
|
507
562
|
blue: ui.Color.Blue300,
|
|
508
563
|
green: ui.Color.Green300,
|
|
@@ -600,7 +655,7 @@ var TextBox = /*#__PURE__*/react.forwardRef((_ref3, ref) => {
|
|
|
600
655
|
noWrap = false,
|
|
601
656
|
wrapOverflow = false
|
|
602
657
|
} = _ref3,
|
|
603
|
-
props = _objectWithoutProperties(_ref3, _excluded$
|
|
658
|
+
props = _objectWithoutProperties(_ref3, _excluded$3);
|
|
604
659
|
|
|
605
660
|
var $align = ui.parseResponsiveProp(align);
|
|
606
661
|
var $color = ui.parseResponsiveProp(color);
|
|
@@ -631,7 +686,7 @@ var DescriptionItemIcon = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
631
686
|
var {
|
|
632
687
|
theme
|
|
633
688
|
} = _ref;
|
|
634
|
-
return styled.css(["display:flex;align-items:center;& > .MuiSvgIcon-root{color:", ";}", ";", "{", ";}"], ui.Color.
|
|
689
|
+
return styled.css(["display:flex;align-items:center;& > .MuiSvgIcon-root{color:", ";}", ";", "{", ";}"], ui.Color.Dark100, descriptionItemIconMixin(20), theme.breakpoints.up('sm'), descriptionItemIconMixin(16));
|
|
635
690
|
});
|
|
636
691
|
var DescriptionItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
637
692
|
var {
|
|
@@ -681,7 +736,7 @@ var DescriptionItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
|
681
736
|
});
|
|
682
737
|
if (process.env.NODE_ENV !== "production") DescriptionItem.displayName = "DescriptionItem";
|
|
683
738
|
|
|
684
|
-
var _excluded$
|
|
739
|
+
var _excluded$4 = ["disabled", "children", "hintText", "startIcon", "fallback", "accept", "maxSize", "maxFiles", "onDropRejected", "onDropAccepted"];
|
|
685
740
|
function toBytes(input, unit) {
|
|
686
741
|
if (unit === 'gb') return input * (1 << 30);
|
|
687
742
|
if (unit === 'mb') return input * (1 << 20);
|
|
@@ -752,7 +807,7 @@ var FileDropZone = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
|
752
807
|
onDropRejected: _onDropRejected,
|
|
753
808
|
onDropAccepted: _onDropAccepted
|
|
754
809
|
} = props,
|
|
755
|
-
dropzoneProps = _objectWithoutProperties(props, _excluded$
|
|
810
|
+
dropzoneProps = _objectWithoutProperties(props, _excluded$4);
|
|
756
811
|
|
|
757
812
|
return /*#__PURE__*/jsxRuntime.jsx(react.Suspense, {
|
|
758
813
|
fallback: fallback,
|
|
@@ -811,7 +866,7 @@ var FileListItemProgress = /*#__PURE__*/styled__default(core.CircularProgress).w
|
|
|
811
866
|
});
|
|
812
867
|
var PdfIcon = /*#__PURE__*/react.memo(props => /*#__PURE__*/jsxRuntime.jsx(core.SvgIcon, _objectSpread(_objectSpread({}, props), {}, {
|
|
813
868
|
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
814
|
-
d: js.
|
|
869
|
+
d: js.mdiFilePdfBox
|
|
815
870
|
})
|
|
816
871
|
})));
|
|
817
872
|
var TextBoxIcon = /*#__PURE__*/react.memo(props => /*#__PURE__*/jsxRuntime.jsx(core.SvgIcon, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -1039,7 +1094,7 @@ var SidebarMenuItemRoot = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
1039
1094
|
var SidebarMenuItemBadge = /*#__PURE__*/styled__default.div.withConfig({
|
|
1040
1095
|
displayName: "SidebarMenuItem__SidebarMenuItemBadge",
|
|
1041
1096
|
componentId: "SD__sc-1sb5zqa-1"
|
|
1042
|
-
})(["font-size:12px;line-height:16px;padding-left:4px;padding-right:4px;border-radius:100px;color:", ";background-color:", ";.MuiButtonBase-root[aria-current='true'] &{color:", ";background-color:", ";}"], ui.Color.
|
|
1097
|
+
})(["font-size:12px;line-height:16px;padding-left:4px;padding-right:4px;border-radius:100px;color:", ";background-color:", ";.MuiButtonBase-root[aria-current='true'] &{color:", ";background-color:", ";}"], ui.Color.Dark500, ui.Color.Silver300, ui.Color.White, ui.Color.Dark450);
|
|
1043
1098
|
var SidebarMenuItemSecondaryAction = /*#__PURE__*/styled__default.div.withConfig({
|
|
1044
1099
|
displayName: "SidebarMenuItem__SidebarMenuItemSecondaryAction",
|
|
1045
1100
|
componentId: "SD__sc-1sb5zqa-2"
|
|
@@ -1210,7 +1265,7 @@ if (process.env.NODE_ENV !== "production") SidebarMenuItemAvatar.displayName = "
|
|
|
1210
1265
|
var SidebarSubheaderRoot = /*#__PURE__*/styled__default.div.withConfig({
|
|
1211
1266
|
displayName: "SidebarSubheader__SidebarSubheaderRoot",
|
|
1212
1267
|
componentId: "SD__sc-1r0xx76-0"
|
|
1213
|
-
})(["height:40px;max-height:40px;padding-left:24px;padding-right:24px;"]);
|
|
1268
|
+
})(["display:flex;align-items:center;height:40px;max-height:40px;padding-left:24px;padding-right:24px;"]);
|
|
1214
1269
|
var SidebarSubheader = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
1215
1270
|
var {
|
|
1216
1271
|
id,
|
|
@@ -1221,6 +1276,7 @@ var SidebarSubheader = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
|
1221
1276
|
ref: ref,
|
|
1222
1277
|
children: /*#__PURE__*/jsxRuntime.jsxs(ui.Columns, {
|
|
1223
1278
|
space: "xsmall",
|
|
1279
|
+
align: "center",
|
|
1224
1280
|
children: [/*#__PURE__*/jsxRuntime.jsx(ui.Column, {
|
|
1225
1281
|
children: /*#__PURE__*/jsxRuntime.jsx(TextBox, {
|
|
1226
1282
|
id: id,
|
|
@@ -1240,6 +1296,7 @@ if (process.env.NODE_ENV !== "production") SidebarSubheader.displayName = "Sideb
|
|
|
1240
1296
|
|
|
1241
1297
|
exports.Alert = Alert;
|
|
1242
1298
|
exports.AnchorButton = AnchorButton;
|
|
1299
|
+
exports.Banner = Banner;
|
|
1243
1300
|
exports.Box = Box;
|
|
1244
1301
|
exports.Button = Button;
|
|
1245
1302
|
exports.ButtonArea = ButtonArea;
|