@superdispatch/ui 0.24.7 → 0.24.9

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.
@@ -1,4 +1,5 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import { Color } from "../theme/Color.js";
2
3
  export function overrideMenu(theme) {
3
4
  theme.props.MuiMenu = {
4
5
  getContentAnchorEl: null,
@@ -11,6 +12,11 @@ export function overrideMenu(theme) {
11
12
  horizontal: 'left'
12
13
  }
13
14
  };
15
+ theme.overrides.MuiMenu = {
16
+ paper: {
17
+ border: "1px solid ".concat(Color.Silver400)
18
+ }
19
+ };
14
20
  theme.overrides.MuiMenuItem = {
15
21
  root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
16
22
  paddingTop: theme.spacing(1),
@@ -0,0 +1,7 @@
1
+ export function overridePreloader(theme) {
2
+ theme.overrides.MuiSkeleton = {
3
+ text: {
4
+ borderRadius: '3px'
5
+ }
6
+ };
7
+ }
@@ -3,18 +3,24 @@ export function overrideSnackbar(theme) {
3
3
  anchorOriginBottomCenter: {
4
4
  left: 0,
5
5
  right: 0,
6
- bottom: 0
6
+ bottom: 0,
7
+ padding: theme.spacing(0),
8
+ background: 'transparent'
7
9
  }
8
10
  };
9
11
  theme.overrides.MuiSnackbarContent = {
10
12
  root: {
11
- width: '100%',
12
- borderRadius: 0,
13
13
  minHeight: theme.spacing(7.5),
14
- [theme.breakpoints.up('sm')]: {
15
- width: theme.spacing(54),
16
- maxWidth: theme.spacing(54),
17
- borderRadius: theme.spacing(0.5)
14
+ '&.SD-SnackbarContent-root': {
15
+ width: '100%',
16
+ position: 'relative',
17
+ left: 0,
18
+ right: 0,
19
+ bottom: 0,
20
+ borderRadius: theme.spacing(0),
21
+ [theme.breakpoints.up('sm')]: {
22
+ borderRadius: theme.spacing(0.5)
23
+ }
18
24
  }
19
25
  },
20
26
  message: {
@@ -70,6 +70,10 @@ export function overrideTextField(theme) {
70
70
  }),
71
71
  input: {
72
72
  textOverflow: 'ellipsis',
73
+ '&::placeholder': {
74
+ color: Color.Dark100,
75
+ opacity: 1
76
+ },
73
77
  '&.MuiInputBase-input': {
74
78
  fontSize: theme.spacing(2),
75
79
  [sm]: {
@@ -18,6 +18,7 @@ import { overrideList } from "../list/ListOverrides.js";
18
18
  import { overrideMenu } from "../menu/MenuOverrides.js";
19
19
  import { overridePagination } from "../pagination/PaginationOverrides.js";
20
20
  import { overridePaper } from "../paper/PaperOverrides.js";
21
+ import { overridePreloader } from "../preloader/PreLoaderOverrides.js";
21
22
  import { overrideRadio } from "../radio/RadioOverrides.js";
22
23
  import { ResponsiveContextProvider } from "../responsive/ResponsiveContext.js";
23
24
  import { overrideSnackbar } from "../snackbar/SnackbarOverrides.js";
@@ -85,6 +86,7 @@ function createSuperDispatchTheme() {
85
86
  overrideTooltip(theme);
86
87
  overrideTypography(theme);
87
88
  overridePagination(theme);
89
+ overridePreloader(theme);
88
90
  return theme;
89
91
  }
90
92
 
@@ -97,6 +99,10 @@ function generateClassName(rule, sheet) {
97
99
  } = (sheet === null || sheet === void 0 ? void 0 : sheet.options) || {};
98
100
 
99
101
  if (meta && rule.type === 'style') {
102
+ if (meta.startsWith('MuiSnackbar') && sheet) {
103
+ return "SDSnackbar-".concat(rule.key);
104
+ }
105
+
100
106
  if (meta.startsWith('SD-')) {
101
107
  return "".concat(meta, "-").concat(rule.key);
102
108
  }
@@ -21,7 +21,7 @@ export function useVisibilityObserver(node) {
21
21
 
22
22
  var observer = new IntersectionObserver(_ref => {
23
23
  var [entry] = _ref;
24
- setState(entry !== null && entry !== void 0 && entry.isIntersecting ? 'visible' : 'invisible');
24
+ setState(entry !== null && entry !== void 0 && entry.isIntersecting && document.visibilityState === 'visible' ? 'visible' : 'invisible');
25
25
  }, {
26
26
  rootMargin,
27
27
  threshold
@@ -6,6 +6,7 @@ import { Property } from 'csstype';
6
6
  import { CommonProps } from '@material-ui/core/OverridableComponent';
7
7
  import { NumberFormatProps } from 'react-number-format';
8
8
  import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
9
+ import { SkeletonClassKey } from '@material-ui/lab';
9
10
 
10
11
  interface ButtonProps extends RefAttributes<HTMLButtonElement>, Omit<ButtonProps$1, 'color'> {
11
12
  rel?: string;
@@ -471,6 +472,11 @@ declare enum Color {
471
472
  declare type ColorProp = keyof typeof Color;
472
473
  declare function isColorProp(name: unknown): name is ColorProp;
473
474
 
475
+ declare module '@material-ui/core/styles/overrides' {
476
+ interface ComponentNameToClassKey {
477
+ MuiSkeleton: SkeletonClassKey;
478
+ }
479
+ }
474
480
  declare type SuperDispatchTheme = Readonly<Required<Theme>>;
475
481
 
476
482
  interface ThemeProviderProps {
package/dist-web/index.js CHANGED
@@ -1114,7 +1114,7 @@ function useVisibilityObserver(node) {
1114
1114
 
1115
1115
  var observer = new IntersectionObserver(_ref => {
1116
1116
  var [entry] = _ref;
1117
- setState(entry !== null && entry !== void 0 && entry.isIntersecting ? 'visible' : 'invisible');
1117
+ setState(entry !== null && entry !== void 0 && entry.isIntersecting && document.visibilityState === 'visible' ? 'visible' : 'invisible');
1118
1118
  }, {
1119
1119
  rootMargin,
1120
1120
  threshold
@@ -3143,6 +3143,11 @@ function overrideMenu(theme) {
3143
3143
  horizontal: 'left'
3144
3144
  }
3145
3145
  };
3146
+ theme.overrides.MuiMenu = {
3147
+ paper: {
3148
+ border: "1px solid ".concat(Color.Silver400)
3149
+ }
3150
+ };
3146
3151
  theme.overrides.MuiMenuItem = {
3147
3152
  root: _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
3148
3153
  paddingTop: theme.spacing(1),
@@ -3202,6 +3207,14 @@ function overridePaper(theme) {
3202
3207
  };
3203
3208
  }
3204
3209
 
3210
+ function overridePreloader(theme) {
3211
+ theme.overrides.MuiSkeleton = {
3212
+ text: {
3213
+ borderRadius: '3px'
3214
+ }
3215
+ };
3216
+ }
3217
+
3205
3218
  function overrideRadio(theme) {
3206
3219
  theme.props.MuiRadio = {
3207
3220
  color: 'primary',
@@ -3256,18 +3269,24 @@ function overrideSnackbar(theme) {
3256
3269
  anchorOriginBottomCenter: {
3257
3270
  left: 0,
3258
3271
  right: 0,
3259
- bottom: 0
3272
+ bottom: 0,
3273
+ padding: theme.spacing(0),
3274
+ background: 'transparent'
3260
3275
  }
3261
3276
  };
3262
3277
  theme.overrides.MuiSnackbarContent = {
3263
3278
  root: {
3264
- width: '100%',
3265
- borderRadius: 0,
3266
3279
  minHeight: theme.spacing(7.5),
3267
- [theme.breakpoints.up('sm')]: {
3268
- width: theme.spacing(54),
3269
- maxWidth: theme.spacing(54),
3270
- borderRadius: theme.spacing(0.5)
3280
+ '&.SD-SnackbarContent-root': {
3281
+ width: '100%',
3282
+ position: 'relative',
3283
+ left: 0,
3284
+ right: 0,
3285
+ bottom: 0,
3286
+ borderRadius: theme.spacing(0),
3287
+ [theme.breakpoints.up('sm')]: {
3288
+ borderRadius: theme.spacing(0.5)
3289
+ }
3271
3290
  }
3272
3291
  },
3273
3292
  message: {
@@ -3496,6 +3515,10 @@ function overrideTextField(theme) {
3496
3515
  }),
3497
3516
  input: {
3498
3517
  textOverflow: 'ellipsis',
3518
+ '&::placeholder': {
3519
+ color: Color.Dark100,
3520
+ opacity: 1
3521
+ },
3499
3522
  '&.MuiInputBase-input': {
3500
3523
  fontSize: theme.spacing(2),
3501
3524
  [sm]: {
@@ -3868,6 +3891,7 @@ function createSuperDispatchTheme() {
3868
3891
  overrideTooltip(theme);
3869
3892
  overrideTypography(theme);
3870
3893
  overridePagination(theme);
3894
+ overridePreloader(theme);
3871
3895
  return theme;
3872
3896
  }
3873
3897
 
@@ -3880,6 +3904,10 @@ function generateClassName(rule, sheet) {
3880
3904
  } = (sheet === null || sheet === void 0 ? void 0 : sheet.options) || {};
3881
3905
 
3882
3906
  if (meta && rule.type === 'style') {
3907
+ if (meta.startsWith('MuiSnackbar') && sheet) {
3908
+ return "SDSnackbar-".concat(rule.key);
3909
+ }
3910
+
3883
3911
  if (meta.startsWith('SD-')) {
3884
3912
  return "".concat(meta, "-").concat(rule.key);
3885
3913
  }