@superdispatch/ui-lab 0.12.0 → 0.16.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 +75 -17
- package/dist-node/index.js.map +1 -1
- package/dist-src/banner/Banner.js +61 -0
- package/dist-src/button/Button.js +1 -1
- package/dist-src/button-area/ButtonArea.js +1 -1
- package/dist-src/description-item/DescriptionItem.js +1 -1
- 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 +77 -20
- package/dist-web/index.js.map +1 -1
- package/package.json +4 -4
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), {}, {
|
|
@@ -498,10 +553,11 @@ function mergeStyles(styles) {
|
|
|
498
553
|
return styles;
|
|
499
554
|
}
|
|
500
555
|
|
|
501
|
-
var _excluded$
|
|
556
|
+
var _excluded$3 = ["variant", "as", "align", "color", "display", "noWrap", "wrapOverflow"];
|
|
502
557
|
var normalizeTextColor = /*#__PURE__*/createRuleNormalizer({
|
|
503
|
-
|
|
504
|
-
|
|
558
|
+
inherit: 'inherit',
|
|
559
|
+
primary: ui.Color.Dark500,
|
|
560
|
+
secondary: ui.Color.Dark200,
|
|
505
561
|
white: ui.Color.White,
|
|
506
562
|
blue: ui.Color.Blue300,
|
|
507
563
|
green: ui.Color.Green300,
|
|
@@ -599,7 +655,7 @@ var TextBox = /*#__PURE__*/react.forwardRef((_ref3, ref) => {
|
|
|
599
655
|
noWrap = false,
|
|
600
656
|
wrapOverflow = false
|
|
601
657
|
} = _ref3,
|
|
602
|
-
props = _objectWithoutProperties(_ref3, _excluded$
|
|
658
|
+
props = _objectWithoutProperties(_ref3, _excluded$3);
|
|
603
659
|
|
|
604
660
|
var $align = ui.parseResponsiveProp(align);
|
|
605
661
|
var $color = ui.parseResponsiveProp(color);
|
|
@@ -630,7 +686,7 @@ var DescriptionItemIcon = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
630
686
|
var {
|
|
631
687
|
theme
|
|
632
688
|
} = _ref;
|
|
633
|
-
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));
|
|
634
690
|
});
|
|
635
691
|
var DescriptionItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
636
692
|
var {
|
|
@@ -680,7 +736,7 @@ var DescriptionItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
|
680
736
|
});
|
|
681
737
|
if (process.env.NODE_ENV !== "production") DescriptionItem.displayName = "DescriptionItem";
|
|
682
738
|
|
|
683
|
-
var _excluded$
|
|
739
|
+
var _excluded$4 = ["disabled", "children", "hintText", "startIcon", "fallback", "accept", "maxSize", "maxFiles", "onDropRejected", "onDropAccepted"];
|
|
684
740
|
function toBytes(input, unit) {
|
|
685
741
|
if (unit === 'gb') return input * (1 << 30);
|
|
686
742
|
if (unit === 'mb') return input * (1 << 20);
|
|
@@ -751,7 +807,7 @@ var FileDropZone = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
|
751
807
|
onDropRejected: _onDropRejected,
|
|
752
808
|
onDropAccepted: _onDropAccepted
|
|
753
809
|
} = props,
|
|
754
|
-
dropzoneProps = _objectWithoutProperties(props, _excluded$
|
|
810
|
+
dropzoneProps = _objectWithoutProperties(props, _excluded$4);
|
|
755
811
|
|
|
756
812
|
return /*#__PURE__*/jsxRuntime.jsx(react.Suspense, {
|
|
757
813
|
fallback: fallback,
|
|
@@ -1038,7 +1094,7 @@ var SidebarMenuItemRoot = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
1038
1094
|
var SidebarMenuItemBadge = /*#__PURE__*/styled__default.div.withConfig({
|
|
1039
1095
|
displayName: "SidebarMenuItem__SidebarMenuItemBadge",
|
|
1040
1096
|
componentId: "SD__sc-1sb5zqa-1"
|
|
1041
|
-
})(["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);
|
|
1042
1098
|
var SidebarMenuItemSecondaryAction = /*#__PURE__*/styled__default.div.withConfig({
|
|
1043
1099
|
displayName: "SidebarMenuItem__SidebarMenuItemSecondaryAction",
|
|
1044
1100
|
componentId: "SD__sc-1sb5zqa-2"
|
|
@@ -1209,7 +1265,7 @@ if (process.env.NODE_ENV !== "production") SidebarMenuItemAvatar.displayName = "
|
|
|
1209
1265
|
var SidebarSubheaderRoot = /*#__PURE__*/styled__default.div.withConfig({
|
|
1210
1266
|
displayName: "SidebarSubheader__SidebarSubheaderRoot",
|
|
1211
1267
|
componentId: "SD__sc-1r0xx76-0"
|
|
1212
|
-
})(["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;"]);
|
|
1213
1269
|
var SidebarSubheader = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
1214
1270
|
var {
|
|
1215
1271
|
id,
|
|
@@ -1220,6 +1276,7 @@ var SidebarSubheader = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
|
1220
1276
|
ref: ref,
|
|
1221
1277
|
children: /*#__PURE__*/jsxRuntime.jsxs(ui.Columns, {
|
|
1222
1278
|
space: "xsmall",
|
|
1279
|
+
align: "center",
|
|
1223
1280
|
children: [/*#__PURE__*/jsxRuntime.jsx(ui.Column, {
|
|
1224
1281
|
children: /*#__PURE__*/jsxRuntime.jsx(TextBox, {
|
|
1225
1282
|
id: id,
|
|
@@ -1239,6 +1296,7 @@ if (process.env.NODE_ENV !== "production") SidebarSubheader.displayName = "Sideb
|
|
|
1239
1296
|
|
|
1240
1297
|
exports.Alert = Alert;
|
|
1241
1298
|
exports.AnchorButton = AnchorButton;
|
|
1299
|
+
exports.Banner = Banner;
|
|
1242
1300
|
exports.Box = Box;
|
|
1243
1301
|
exports.Button = Button;
|
|
1244
1302
|
exports.ButtonArea = ButtonArea;
|