@superdispatch/ui-lab 0.13.0 → 0.17.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.
@@ -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,7 +271,7 @@ 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"
@@ -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$1 = ["children", "endIcon", "startIcon", "tabIndex", "active", "pending", "disabled", "size", "fullWidth", "variant"],
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) {
@@ -413,7 +468,7 @@ function useButtonProps(_ref3) {
413
468
  fullWidth = false,
414
469
  variant = 'default'
415
470
  } = _ref3,
416
- props = _objectWithoutProperties(_ref3, _excluded$1);
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,8 +553,9 @@ function mergeStyles(styles) {
498
553
  return styles;
499
554
  }
500
555
 
501
- var _excluded$2 = ["variant", "as", "align", "color", "display", "noWrap", "wrapOverflow"];
556
+ var _excluded$3 = ["variant", "as", "align", "color", "display", "noWrap", "wrapOverflow"];
502
557
  var normalizeTextColor = /*#__PURE__*/createRuleNormalizer({
558
+ inherit: 'inherit',
503
559
  primary: ui.Color.Dark500,
504
560
  secondary: ui.Color.Dark200,
505
561
  white: ui.Color.White,
@@ -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$2);
658
+ props = _objectWithoutProperties(_ref3, _excluded$3);
603
659
 
604
660
  var $align = ui.parseResponsiveProp(align);
605
661
  var $color = ui.parseResponsiveProp(color);
@@ -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$3 = ["disabled", "children", "hintText", "startIcon", "fallback", "accept", "maxSize", "maxFiles", "onDropRejected", "onDropAccepted"];
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$3);
810
+ dropzoneProps = _objectWithoutProperties(props, _excluded$4);
755
811
 
756
812
  return /*#__PURE__*/jsxRuntime.jsx(react.Suspense, {
757
813
  fallback: fallback,
@@ -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;