@superdispatch/ui 0.39.0 → 0.39.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.
@@ -17,6 +17,7 @@ var resizeObserver = require('@juggle/resize-observer');
17
17
  var hooks = require('@superdispatch/hooks');
18
18
  var clsx = _interopDefault(require('clsx'));
19
19
  var flattenChildren = _interopDefault(require('react-keyed-flatten-children'));
20
+ var ui = require('@superdispatch/ui');
20
21
  var reactNumberFormat = require('react-number-format');
21
22
  var createBreakpoints = _interopDefault(require('@material-ui/core/styles/createBreakpoints'));
22
23
 
@@ -1751,7 +1752,21 @@ var InlineGrid = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1751
1752
  });
1752
1753
  if (process.env.NODE_ENV !== "production") InlineGrid.displayName = "InlineGrid";
1753
1754
 
1754
- var _excluded$g = ["size", "square", "classes", "children", "className", "CardContentProps"],
1755
+ var _excluded$g = ["srcDark", "src"];
1756
+ function Image(_ref) {
1757
+ var {
1758
+ srcDark,
1759
+ src
1760
+ } = _ref,
1761
+ props = _objectWithoutProperties(_ref, _excluded$g);
1762
+ var theme = core.useTheme();
1763
+ var value = theme.palette.type === 'dark' && srcDark ? srcDark : src;
1764
+ return /*#__PURE__*/jsxRuntime.jsx("img", _objectSpread(_objectSpread({}, props), {}, {
1765
+ src: value
1766
+ }));
1767
+ }
1768
+
1769
+ var _excluded$h = ["size", "square", "classes", "children", "className", "CardContentProps"],
1755
1770
  _excluded2$2 = ["content", "sizeLarge", "fullWidth"];
1756
1771
  var useStyles$a = /*#__PURE__*/styles.makeStyles(theme => ({
1757
1772
  root: {
@@ -1783,7 +1798,7 @@ var InfoCard = /*#__PURE__*/React.forwardRef((_ref, _ref2) => {
1783
1798
  className,
1784
1799
  CardContentProps: cardContentProps = {}
1785
1800
  } = _ref,
1786
- props = _objectWithoutProperties(_ref, _excluded$g);
1801
+ props = _objectWithoutProperties(_ref, _excluded$h);
1787
1802
  var _useStyles = useStyles$a({
1788
1803
  classes
1789
1804
  }),
@@ -1811,7 +1826,7 @@ var InfoCard = /*#__PURE__*/React.forwardRef((_ref, _ref2) => {
1811
1826
  });
1812
1827
  if (process.env.NODE_ENV !== "production") InfoCard.displayName = "InfoCard";
1813
1828
 
1814
- var _excluded$h = ["children", "iconButtonProps", "fontSize", "TextProps", "title", "isOpen", "onClick", "onClose"];
1829
+ var _excluded$i = ["children", "iconButtonProps", "fontSize", "TextProps", "title", "isOpen", "onClick", "onClose"];
1815
1830
  var Root = /*#__PURE__*/styled__default.div.withConfig({
1816
1831
  displayName: "InfoTooltip__Root",
1817
1832
  componentId: "SD__sc-1emqpa9-0"
@@ -1827,7 +1842,7 @@ var InfoTooltip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1827
1842
  onClick,
1828
1843
  onClose
1829
1844
  } = _ref,
1830
- props = _objectWithoutProperties(_ref, _excluded$h);
1845
+ props = _objectWithoutProperties(_ref, _excluded$i);
1831
1846
  var tooltip = /*#__PURE__*/jsxRuntime.jsx(core.Tooltip, _objectSpread(_objectSpread({
1832
1847
  open: isOpen,
1833
1848
  title: title,
@@ -1904,7 +1919,18 @@ var Inline = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
1904
1919
  });
1905
1920
  if (process.env.NODE_ENV !== "production") Inline.displayName = "Inline";
1906
1921
 
1907
- var _excluded$i = ["value", "inputRef", "onChange", "valueIsNumericString", "thousandSeparator", "disableValueParsing"],
1922
+ function LightDark(_ref) {
1923
+ var {
1924
+ light,
1925
+ dark
1926
+ } = _ref;
1927
+ var theme = core.useTheme();
1928
+ var isDarkMode = theme.palette.type === 'dark';
1929
+ var mode = isDarkMode ? dark : light;
1930
+ return ui.renderChildren(mode);
1931
+ }
1932
+
1933
+ var _excluded$j = ["value", "inputRef", "onChange", "valueIsNumericString", "thousandSeparator", "disableValueParsing"],
1908
1934
  _excluded2$3 = ["value", "inputRef", "onChange", "valueIsNumericString", "thousandSeparator", "disableValueParsing"],
1909
1935
  _excluded3 = ["id", "InputProps", "isText"];
1910
1936
  function NumberInputComponent(_ref) {
@@ -1916,7 +1942,7 @@ function NumberInputComponent(_ref) {
1916
1942
  thousandSeparator = true,
1917
1943
  disableValueParsing
1918
1944
  } = _ref,
1919
- props = _objectWithoutProperties(_ref, _excluded$i);
1945
+ props = _objectWithoutProperties(_ref, _excluded$j);
1920
1946
  return /*#__PURE__*/jsxRuntime.jsx(reactNumberFormat.NumericFormat, _objectSpread(_objectSpread({}, props), {}, {
1921
1947
  value: value !== null && value !== void 0 ? value : '',
1922
1948
  inputMode: "decimal",
@@ -1986,7 +2012,7 @@ var NumberField = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
1986
2012
  if (process.env.NODE_ENV !== "production") NumberField.displayName = "NumberField";
1987
2013
  NumberField.displayName = 'NumberField';
1988
2014
 
1989
- var _excluded$j = ["id", "value", "onChange", "inputMode", "valueIsNumericString", "onValueChange"];
2015
+ var _excluded$k = ["id", "value", "onChange", "inputMode", "valueIsNumericString", "onValueChange"];
1990
2016
  var PatternField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1991
2017
  var {
1992
2018
  id,
@@ -1996,7 +2022,7 @@ var PatternField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1996
2022
  valueIsNumericString = true,
1997
2023
  onValueChange: _onValueChange
1998
2024
  } = _ref,
1999
- props = _objectWithoutProperties(_ref, _excluded$j);
2025
+ props = _objectWithoutProperties(_ref, _excluded$k);
2000
2026
  var uid = useUID(id);
2001
2027
  return /*#__PURE__*/jsxRuntime.jsx(reactNumberFormat.PatternFormat, _objectSpread(_objectSpread({}, props), {}, {
2002
2028
  id: uid,
@@ -2024,7 +2050,7 @@ var PatternField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2024
2050
  if (process.env.NODE_ENV !== "production") PatternField.displayName = "PatternField";
2025
2051
  PatternField.displayName = 'PatternField';
2026
2052
 
2027
- var _excluded$k = ["label", "error", "checked", "onBlur", "onChange", "helperText", "FormControlProps", "FormControlLabelProps"];
2053
+ var _excluded$l = ["label", "error", "checked", "onBlur", "onChange", "helperText", "FormControlProps", "FormControlLabelProps"];
2028
2054
  var FormControl$1 = /*#__PURE__*/styled__default(core.FormControl).withConfig({
2029
2055
  displayName: "RadioField__FormControl",
2030
2056
  componentId: "SD__sc-6ey4qt-0"
@@ -2044,7 +2070,7 @@ var RadioField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2044
2070
  FormControlProps: formControlProps,
2045
2071
  FormControlLabelProps: formControlLabelProps
2046
2072
  } = _ref,
2047
- props = _objectWithoutProperties(_ref, _excluded$k);
2073
+ props = _objectWithoutProperties(_ref, _excluded$l);
2048
2074
  return /*#__PURE__*/jsxRuntime.jsxs(FormControl$1, _objectSpread(_objectSpread({
2049
2075
  error: error
2050
2076
  }, formControlProps), {}, {
@@ -2064,7 +2090,7 @@ var RadioField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2064
2090
  });
2065
2091
  if (process.env.NODE_ENV !== "production") RadioField.displayName = "RadioField";
2066
2092
 
2067
- var _excluded$l = ["name", "value", "label", "caption", "disabled", "icon", "checked", "onChange"];
2093
+ var _excluded$m = ["name", "value", "label", "caption", "disabled", "icon", "checked", "onChange"];
2068
2094
  var ClickableCard = /*#__PURE__*/styled__default(core.ButtonBase).withConfig({
2069
2095
  displayName: "RadioFieldCard__ClickableCard",
2070
2096
  componentId: "SD__sc-5etge2-0"
@@ -2101,7 +2127,7 @@ var RadioFieldCard = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
2101
2127
  checked,
2102
2128
  onChange
2103
2129
  } = _ref2,
2104
- props = _objectWithoutProperties(_ref2, _excluded$l);
2130
+ props = _objectWithoutProperties(_ref2, _excluded$m);
2105
2131
  return /*#__PURE__*/jsxRuntime.jsx(Card, {
2106
2132
  disabled: disabled,
2107
2133
  children: /*#__PURE__*/jsxRuntime.jsx(ClickableCard, _objectSpread(_objectSpread({
@@ -2142,7 +2168,7 @@ var RadioFieldCard = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
2142
2168
  });
2143
2169
  if (process.env.NODE_ENV !== "production") RadioFieldCard.displayName = "RadioFieldCard";
2144
2170
 
2145
- var _excluded$m = ["name", "value", "onChange", "RadioGroupProps", "label", "FormLabelProps", "helperText", "FormHelperTextProps", "children"];
2171
+ var _excluded$n = ["name", "value", "onChange", "RadioGroupProps", "label", "FormLabelProps", "helperText", "FormHelperTextProps", "children"];
2146
2172
  var FormLabel$1 = /*#__PURE__*/styled__default(core.FormLabel).withConfig({
2147
2173
  displayName: "RadioGroupField__FormLabel",
2148
2174
  componentId: "SD__sc-1udxviq-0"
@@ -2163,7 +2189,7 @@ var RadioGroupField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2163
2189
  FormHelperTextProps: formHelperTextProps,
2164
2190
  children
2165
2191
  } = _ref,
2166
- formControlProps = _objectWithoutProperties(_ref, _excluded$m);
2192
+ formControlProps = _objectWithoutProperties(_ref, _excluded$n);
2167
2193
  return /*#__PURE__*/jsxRuntime.jsxs(core.FormControl, _objectSpread(_objectSpread({}, formControlProps), {}, {
2168
2194
  hiddenLabel: !label,
2169
2195
  children: [!!label && /*#__PURE__*/jsxRuntime.jsx(FormLabel$1, _objectSpread(_objectSpread({}, formLabelProps), {}, {
@@ -2208,7 +2234,7 @@ function useMinBreakpoint(minBreakpoint) {
2208
2234
  return minBreakpointIDX < breakpointIDX;
2209
2235
  }
2210
2236
 
2211
- var _excluded$n = ["action", "children", "onClose", "className", "classes", "variant"],
2237
+ var _excluded$o = ["action", "children", "onClose", "className", "classes", "variant"],
2212
2238
  _excluded2$4 = ["icon", "closeButton", "variantError", "variantSuccess"];
2213
2239
  var PaddedContent = /*#__PURE__*/styled__default.span.withConfig({
2214
2240
  displayName: "SnackbarContent__PaddedContent",
@@ -2266,7 +2292,7 @@ var SnackbarContent = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2266
2292
  classes,
2267
2293
  variant = 'default'
2268
2294
  } = _ref,
2269
- props = _objectWithoutProperties(_ref, _excluded$n);
2295
+ props = _objectWithoutProperties(_ref, _excluded$o);
2270
2296
  var _useStyles = useStyles$b({
2271
2297
  classes
2272
2298
  }),
@@ -2316,7 +2342,7 @@ var SnackbarContent = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2316
2342
  });
2317
2343
  if (process.env.NODE_ENV !== "production") SnackbarContent.displayName = "SnackbarContent";
2318
2344
 
2319
- var _excluded$o = ["open", "action", "variant", "onClose", "children", "ContentProps", "hasCloseButton", "TransitionComponent"];
2345
+ var _excluded$p = ["open", "action", "variant", "onClose", "children", "ContentProps", "hasCloseButton", "TransitionComponent"];
2320
2346
  function SlideTransition(props) {
2321
2347
  return /*#__PURE__*/jsxRuntime.jsx(core.Slide, _objectSpread(_objectSpread({}, props), {}, {
2322
2348
  direction: "up"
@@ -2333,7 +2359,7 @@ var Snackbar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2333
2359
  hasCloseButton = onClose != null,
2334
2360
  TransitionComponent = SlideTransition
2335
2361
  } = _ref,
2336
- props = _objectWithoutProperties(_ref, _excluded$o);
2362
+ props = _objectWithoutProperties(_ref, _excluded$p);
2337
2363
  function handleClose(reason) {
2338
2364
  if (reason !== 'clickaway') {
2339
2365
  onClose === null || onClose === void 0 ? void 0 : onClose(reason === 'timeout' ? 'timeout' : 'explicit');
@@ -2360,7 +2386,7 @@ var Snackbar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2360
2386
  });
2361
2387
  if (process.env.NODE_ENV !== "production") Snackbar.displayName = "Snackbar";
2362
2388
 
2363
- var _excluded$p = ["onClose", "variant", "key", "id", "autoHideDuration"];
2389
+ var _excluded$q = ["onClose", "variant", "key", "id", "autoHideDuration"];
2364
2390
  function warnContext() {
2365
2391
  // eslint-disable-next-line no-console
2366
2392
  console.log('`useSnackbarStack` is used outside of `SnackbarStackProvider`.');
@@ -2405,7 +2431,7 @@ function SnackbarStackProvider(_ref2) {
2405
2431
  id = String(key),
2406
2432
  autoHideDuration = 5000
2407
2433
  } = _ref3,
2408
- props = _objectWithoutProperties(_ref3, _excluded$p);
2434
+ props = _objectWithoutProperties(_ref3, _excluded$q);
2409
2435
  function removeSnackbar() {
2410
2436
  setStack(prev => {
2411
2437
  if (prev.has(key)) {
@@ -2496,7 +2522,7 @@ var Stack = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
2496
2522
  });
2497
2523
  if (process.env.NODE_ENV !== "production") Stack.displayName = "Stack";
2498
2524
 
2499
- var _excluded$q = ["color", "variant", "children", "classes", "className", "noWrap", "fontWeight", "component"];
2525
+ var _excluded$r = ["color", "variant", "children", "classes", "className", "noWrap", "fontWeight", "component"];
2500
2526
  var useStyles$c = /*#__PURE__*/styles.makeStyles(theme => ({
2501
2527
  root: {
2502
2528
  maxWidth: '100%',
@@ -2590,7 +2616,7 @@ var Tag = /*#__PURE__*/React.forwardRef((_ref, ref) => {
2590
2616
  fontWeight = 'bold',
2591
2617
  component = 'div'
2592
2618
  } = _ref,
2593
- props = _objectWithoutProperties(_ref, _excluded$q);
2619
+ props = _objectWithoutProperties(_ref, _excluded$r);
2594
2620
  var styles = useStyles$c({
2595
2621
  classes
2596
2622
  });
@@ -4306,10 +4332,12 @@ exports.DrawerTitle = DrawerTitle;
4306
4332
  exports.DropdownButton = DropdownButton;
4307
4333
  exports.ExitTransitionPlaceholder = ExitTransitionPlaceholder;
4308
4334
  exports.GridStack = GridStack;
4335
+ exports.Image = Image;
4309
4336
  exports.InfoCard = InfoCard;
4310
4337
  exports.InfoTooltip = InfoTooltip;
4311
4338
  exports.Inline = Inline;
4312
4339
  exports.InlineGrid = InlineGrid;
4340
+ exports.LightDark = LightDark;
4313
4341
  exports.NumberField = NumberField;
4314
4342
  exports.OverflowText = OverflowText;
4315
4343
  exports.PatternField = PatternField;