@applica-software-guru/react-admin 1.5.305 → 1.5.306

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/package.json CHANGED
@@ -107,5 +107,5 @@
107
107
  "type": "module",
108
108
  "types": "dist/index.d.ts",
109
109
  "typings": "dist/index.d.ts",
110
- "version": "1.5.305"
110
+ "version": "1.5.306"
111
111
  }
@@ -7,7 +7,9 @@ type ContentProps = {
7
7
 
8
8
  function Content(props: ContentProps) {
9
9
  const { sx } = props;
10
- return <Box sx={{ ...sx, flex: '1 1 auto', backgroundColor: 'background.paper' }}>{props.children}</Box>;
10
+ return (
11
+ <Box sx={{ ...sx, flex: '1 1 auto', backgroundColor: 'background.paper', overflowY: 'auto' }}>{props.children}</Box>
12
+ );
11
13
  }
12
14
 
13
15
  export { Content };
@@ -10,21 +10,24 @@ type DrawerProps = {
10
10
  variant?: 'temporary' | 'persistent' | 'permanent';
11
11
  children: React.ReactNode;
12
12
  open?: boolean;
13
+ onClose?: () => void;
13
14
  };
14
15
 
15
16
  function Drawer(props: DrawerProps) {
16
- const { PaperProps, anchor = 'right', variant = 'temporary', open = false } = props;
17
+ const { PaperProps, anchor = 'right', variant = 'temporary', open = false, onClose } = props;
17
18
  const theme = useTheme();
18
19
  const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
19
20
  const anchorPosition = isMobile ? 'bottom' : anchor;
20
21
  const { setSidebarOpen } = useListViewContext();
21
22
  const handleClose = useCallback(() => {
22
- if (isFunction(setSidebarOpen)) {
23
+ if (isFunction(onClose)) {
24
+ onClose();
25
+ } else if (isFunction(setSidebarOpen)) {
23
26
  setSidebarOpen(false);
24
27
  }
25
- }, [setSidebarOpen]);
28
+ }, [onClose, setSidebarOpen]);
26
29
  const sx = useSx(PaperProps ?? {}, {
27
- backgroundColor: 'background.default',
30
+ backgroundImage: 'none',
28
31
  boxShadow: '-10px 4px 42px 0px rgba(0, 0, 0, 0.25)',
29
32
  width: {
30
33
  xs: window.innerWidth,
@@ -1,10 +1,12 @@
1
- import { Box, Divider, Stack, Typography } from '@mui/material';
1
+ import { Box, Divider, Stack, SxProps, Typography } from '@mui/material';
2
2
 
3
3
  interface HeaderProps {
4
+ sx?: SxProps;
4
5
  children: React.ReactNode;
5
6
  }
6
7
 
7
8
  function Header(props: HeaderProps) {
9
+ const { sx } = props;
8
10
  return (
9
11
  <Box>
10
12
  <Stack
@@ -15,6 +17,7 @@ function Header(props: HeaderProps) {
15
17
  py={2}
16
18
  spacing={2}
17
19
  minHeight={'64px'}
20
+ sx={sx}
18
21
  >
19
22
  {props.children}
20
23
  </Stack>
@@ -9,7 +9,7 @@ export * from './MenuProvider';
9
9
  export * from './NavMenu';
10
10
  export * from './Navigation';
11
11
  export * from './Provider';
12
- export * as Sidebar from './Sidebar';
12
+ export * from './Sidebar';
13
13
  export * from './ThemeColor';
14
14
  export * from './ThemeProvider';
15
15
  export * from './ThemeToggler';