@campxdev/shared 0.6.13 → 0.6.15

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/.eslintrc.js CHANGED
@@ -2,22 +2,22 @@ module.exports = {
2
2
  env: {
3
3
  browser: true,
4
4
  es2021: true,
5
- jest: true,
5
+ jest: true
6
6
  },
7
7
  parser: '@typescript-eslint/parser',
8
- extends: ['prettier'],
8
+ extends: ['prettier', 'plugin:storybook/recommended'],
9
9
  overrides: [],
10
10
  parserOptions: {
11
11
  ecmaVersion: 'latest',
12
12
  sourceType: 'module',
13
13
  ecmaFeatures: {
14
- jsx: true,
15
- },
14
+ jsx: true
15
+ }
16
16
  },
17
17
  settings: {
18
18
  'import/resolver': {
19
- typescript: {},
20
- },
19
+ typescript: {}
20
+ }
21
21
  },
22
22
  plugins: ['react', '@typescript-eslint', 'prettier'],
23
23
  rules: {
@@ -28,7 +28,7 @@ module.exports = {
28
28
  'react/prop-types': ['off'],
29
29
  'react/jsx-key': ['warn'],
30
30
  'react/no-unescaped-entities': 'off',
31
- 'spaced-comment': 'off',
31
+ 'spaced-comment': 'off'
32
32
  },
33
- ignorePatterns: ['**/*.html'],
34
- }
33
+ ignorePatterns: ['**/*.html']
34
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -9,7 +9,9 @@
9
9
  "eject": "react-scripts eject",
10
10
  "lint": "eslint ./src/**/*.{js,jsx,ts,tsx,json}",
11
11
  "lint:fix": "eslint --fix \"./src/**/*.{js,jsx,ts,tsx,json}\"",
12
- "format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,css,md,json}\" --config ./.prettierrc"
12
+ "format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,css,md,json}\" --config ./.prettierrc",
13
+ "storybook": "start-storybook -p 6006 -s public",
14
+ "build-storybook": "build-storybook -s public"
13
15
  },
14
16
  "browserslist": {
15
17
  "production": [
@@ -48,6 +50,16 @@
48
50
  "yup": "^0.32.11"
49
51
  },
50
52
  "devDependencies": {
53
+ "@storybook/addon-actions": "^6.5.14",
54
+ "@storybook/addon-essentials": "^6.5.14",
55
+ "@storybook/addon-interactions": "^6.5.14",
56
+ "@storybook/addon-links": "^6.5.14",
57
+ "@storybook/builder-webpack5": "^6.5.14",
58
+ "@storybook/manager-webpack5": "^6.5.14",
59
+ "@storybook/node-logger": "^6.5.14",
60
+ "@storybook/preset-create-react-app": "^4.0.0",
61
+ "@storybook/react": "^6.5.14",
62
+ "@storybook/testing-library": "^0.0.13",
51
63
  "@types/js-cookie": "^3.0.2",
52
64
  "@types/node": "^18.11.8",
53
65
  "@types/react": "^18.0.25",
@@ -59,9 +71,23 @@
59
71
  "eslint-plugin-import": "^2.26.0",
60
72
  "eslint-plugin-prettier": "^4.2.1",
61
73
  "eslint-plugin-react": "^7.31.1",
74
+ "eslint-plugin-storybook": "^0.6.8",
62
75
  "lerna": "^5.5.1",
63
76
  "prettier": "^2.5.0",
64
77
  "react-scripts": "^5.0.1",
78
+ "storybook-addon-react-router-v6": "^0.2.1",
65
79
  "typescript": "^4.8.4"
80
+ },
81
+ "eslintConfig": {
82
+ "overrides": [
83
+ {
84
+ "files": [
85
+ "**/*.stories.*"
86
+ ],
87
+ "rules": {
88
+ "import/no-anonymous-default-export": "off"
89
+ }
90
+ }
91
+ ]
66
92
  }
67
93
  }
@@ -3,8 +3,9 @@ import React from 'react'
3
3
 
4
4
  interface ActionButtonProps extends ButtonProps {
5
5
  loading?: boolean
6
- [key: string]: any
7
- variant?: any
6
+ variant: ButtonProps['variant']
7
+ // [key: string]: any
8
+ // variant?: any
8
9
  }
9
10
 
10
11
  export default function ActionButton({
@@ -7,10 +7,10 @@ import {
7
7
  Typography,
8
8
  } from '@mui/material'
9
9
  import { ReactNode } from 'react'
10
- import { Link, To, useNavigate } from 'react-router-dom'
10
+ import { Link, useNavigate } from 'react-router-dom'
11
11
 
12
12
  interface BreadcrumbsProps {
13
- links: { to: To | null; name: string | ReactNode }[]
13
+ links: { to: string; name: string | ReactNode }[]
14
14
  icon?: ReactNode
15
15
  }
16
16
 
@@ -58,6 +58,7 @@ export default function Card({
58
58
  onClick={handleClick}
59
59
  endIcon={footer?.endIcon ?? <ChevronRight />}
60
60
  {...footer?.buttonProps}
61
+ sx={{ fontSize: '14px' }}
61
62
  >
62
63
  {footer?.buttonText ?? 'View'}
63
64
  </Button>
@@ -74,4 +74,8 @@ const StyledChip = styled(Chip)(({ theme }) => ({
74
74
  background: theme.palette.secondary.light,
75
75
  color: theme.palette.text.primary,
76
76
  },
77
+ height: '40px',
78
+ fontSize: '14px',
79
+ fontWeight: 700,
80
+ borderRadius: '20px',
77
81
  }))
@@ -18,6 +18,7 @@ export default function DividerHeading({
18
18
 
19
19
  const StyledContainer = styled(Box)(({ theme }) => ({
20
20
  margin: '20px 0',
21
+ paddingBottom: '5px',
21
22
  borderBottom: theme.borders.grayLight,
22
23
  display: 'flex',
23
24
  justifyContent: 'space-between',
@@ -16,10 +16,17 @@ export const StyledFooter = styled(Box)<{
16
16
  transition: bottom 400ms ease-in-out;
17
17
  box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.1);
18
18
  `
19
- function FloatingContainer({ children, show }) {
19
+
20
+ function FloatingContainer({
21
+ children,
22
+ show,
23
+ }: {
24
+ show?: boolean
25
+ children: React.ReactNode
26
+ }) {
20
27
  return (
21
28
  <>
22
- <StyledFooter show={show}>{children}</StyledFooter>
29
+ <StyledFooter show={show ? show : true}>{children}</StyledFooter>
23
30
  </>
24
31
  )
25
32
  }
@@ -4,7 +4,15 @@ import { Link } from 'react-router-dom'
4
4
  import { isDevelopment } from '../../../constants/isDevelopment'
5
5
  import { applications } from './applications'
6
6
  import AppsMenu from './AppsMenu'
7
- import { collegex, commutex, enrollx, examx, hostelx, payx, peoplex,} from './assets'
7
+ import {
8
+ collegex,
9
+ commutex,
10
+ enrollx,
11
+ examx,
12
+ hostelx,
13
+ payx,
14
+ peoplex,
15
+ } from './assets'
8
16
 
9
17
  import CogWheelMenu from './CogWheelMenu'
10
18
  import FreshDeskHelpButton from './FreshDeskHelpButton'
@@ -35,8 +43,8 @@ const imageMap = {
35
43
  payments: payx,
36
44
  people: peoplex,
37
45
  campx: collegex,
38
- commute:commutex,
39
- hostel:hostelx
46
+ commute: commutex,
47
+ hostel: hostelx,
40
48
  }
41
49
 
42
50
  interface AppHeaderProps {
@@ -48,7 +48,7 @@ export default function DrawerButton({
48
48
  const [open, setOpen] = useState(false)
49
49
 
50
50
  const ButtonEl = (props) => (
51
- <Button {...props} {...btnProps}>
51
+ <Button {...props} {...btnProps} sx={{ fontSize: '14px', fontWeight: 600 }}>
52
52
  {btnTxt}
53
53
  </Button>
54
54
  )
@@ -0,0 +1,7 @@
1
+ import React from 'react'
2
+
3
+ function Router() {
4
+ return <div>Router</div>
5
+ }
6
+
7
+ export default Router
@@ -103,7 +103,10 @@ export default function Table({
103
103
  }}
104
104
  >
105
105
  <>
106
- <Box>{col.title}</Box>
106
+ <Box sx={{ fontWeight: 600, fontSize: '14px' }}>
107
+ {' '}
108
+ {col.title}
109
+ </Box>
107
110
  </>
108
111
  {col.sort && (
109
112
  <IconButton onClick={() => handleSortClick(col.dataIndex)}>
@@ -140,6 +143,8 @@ export default function Table({
140
143
  sx={{
141
144
  color: col.textColor,
142
145
  padding: dense ? '10px' : '15px',
146
+ font: 'avenir',
147
+ fontSize: '14px',
143
148
  }}
144
149
  key={colIndex}
145
150
  >
@@ -22,15 +22,15 @@ export default function Providers({ children }: { children: ReactNode }) {
22
22
  <BrowserRouter basename={isDevelopment ? 'campx_dev' : urlTenantKey}>
23
23
  <QueryClientProvider>
24
24
  <MuiThemeProvider>
25
- <DialogProvider>
26
- <LoginFormProvider>
27
- <ConfirmContextProvider>
25
+ <ConfirmContextProvider>
26
+ <DialogProvider>
27
+ <LoginFormProvider>
28
28
  {isInvalid ? <InvalidClientKey /> : children}
29
- </ConfirmContextProvider>
30
- <CssBaseline />
31
- </LoginFormProvider>
32
- <ToastContainer />
33
- </DialogProvider>
29
+ <CssBaseline />
30
+ </LoginFormProvider>
31
+ <ToastContainer />
32
+ </DialogProvider>
33
+ </ConfirmContextProvider>
34
34
  </MuiThemeProvider>
35
35
  </QueryClientProvider>
36
36
  </BrowserRouter>