@campxdev/campx-web-utils 0.2.9 → 0.2.10

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/campx-web-utils",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "main": "./export.ts",
5
5
  "private": false,
6
6
  "dependencies": {
@@ -15,6 +15,7 @@
15
15
  "@types/react": "^18.0.0",
16
16
  "@types/react-dom": "^18.0.0",
17
17
  "axios": "^1.7.2",
18
+ "framer-motion": "^11.3.21",
18
19
  "cookie-js": "^0.0.1",
19
20
  "date-fns": "^3.6.0",
20
21
  "device-detector-js": "^3.0.3",
@@ -1,6 +1,7 @@
1
1
  import { AppHeader, Sidebar, Spinner } from '@campxdev/react-blueprint';
2
2
  import { SideMenuItemProps } from '@campxdev/react-blueprint/src/components/Navigation/Sidebar/Sidebar';
3
3
  import { Box, Stack, useTheme } from '@mui/material';
4
+ import { motion } from 'framer-motion';
4
5
  import { Suspense, useState } from 'react';
5
6
  import { ErrorBoundary } from '../context/export';
6
7
 
@@ -24,33 +25,56 @@ export const AppLayout: React.FC<Props> = ({
24
25
  direction={'row'}
25
26
  >
26
27
  <Sidebar menu={menu} collapsed={collapsed} setCollapsed={setCollapsed} />
27
- <Stack
28
- margin="12px 12px 12px 0px"
29
- gap="12px"
30
- width={collapsed ? 'calc(100% - 84px)' : 'calc(100% - 278px)'}
28
+ <motion.div
29
+ animate={{
30
+ width: collapsed ? 'calc(100% - 84px)' : 'calc(100% - 278px)',
31
+ }}
32
+ transition={{ duration: 0.3, ease: 'circOut' }}
33
+ style={{
34
+ margin: '12px 12px 12px 0px',
35
+ width: 'calc(100% - 84px)',
36
+ }}
31
37
  >
32
- <AppHeader
33
- actions={[]}
34
- collapsed={collapsed}
35
- showActiveDevices={false}
36
- clientName={''}
37
- userFullName={''}
38
- />
39
- <Box
40
- sx={{
41
- borderRadius: '8px',
42
- height: '-webkit-fill-available',
43
- ...mainContainerSx,
44
- }}
45
- onClick={() => {
46
- setCollapsed(true);
47
- }}
48
- >
49
- <Suspense fallback={<Spinner />}>
50
- <ErrorBoundary>{children}</ErrorBoundary>
51
- </Suspense>
52
- </Box>
53
- </Stack>
38
+ <Stack gap="12px">
39
+ <AppHeader
40
+ actions={[]}
41
+ collapsed={collapsed}
42
+ showActiveDevices={false}
43
+ clientName={''}
44
+ userFullName={''}
45
+ />
46
+ <Box
47
+ sx={{
48
+ // backgroundColor: theme.palette.surface.paperBackground,
49
+ borderRadius: '8px',
50
+ height: 'calc(100vh - 96px)',
51
+ overflowY: 'scroll',
52
+ paddingRight: '8px',
53
+ '&::-webkit-scrollbar': {
54
+ width: '0.5em',
55
+ height: '0.2em',
56
+ },
57
+
58
+ '&::-webkit-scrollbar-thumb': {
59
+ backgroundColor: theme.palette.primary.light,
60
+ borderRadius: '3px',
61
+
62
+ '&:hover': {
63
+ backgroundColor: theme.palette.primary.main,
64
+ },
65
+ },
66
+ ...mainContainerSx,
67
+ }}
68
+ onClick={() => {
69
+ setCollapsed(true);
70
+ }}
71
+ >
72
+ <Suspense fallback={<Spinner />}>
73
+ <ErrorBoundary>{children}</ErrorBoundary>
74
+ </Suspense>
75
+ </Box>
76
+ </Stack>
77
+ </motion.div>
54
78
  </Stack>
55
79
  );
56
80
  };