@superdispatch/ui-lab 0.14.0 → 0.17.1

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,7 +553,7 @@ 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({
503
558
  inherit: 'inherit',
504
559
  primary: ui.Color.Dark500,
@@ -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$2);
658
+ props = _objectWithoutProperties(_ref3, _excluded$3);
604
659
 
605
660
  var $align = ui.parseResponsiveProp(align);
606
661
  var $color = ui.parseResponsiveProp(color);
@@ -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$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"];
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$3);
810
+ dropzoneProps = _objectWithoutProperties(props, _excluded$4);
756
811
 
757
812
  return /*#__PURE__*/jsxRuntime.jsx(react.Suspense, {
758
813
  fallback: fallback,
@@ -1241,6 +1296,7 @@ if (process.env.NODE_ENV !== "production") SidebarSubheader.displayName = "Sideb
1241
1296
 
1242
1297
  exports.Alert = Alert;
1243
1298
  exports.AnchorButton = AnchorButton;
1299
+ exports.Banner = Banner;
1244
1300
  exports.Box = Box;
1245
1301
  exports.Button = Button;
1246
1302
  exports.ButtonArea = ButtonArea;