@nethru/ui 2.0.3 → 2.0.4
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/base/AccordionSummary.js +52 -0
- package/base/assets/icons.js +11 -0
- package/base/frame/sidebar/css/primary.module.css +1 -4
- package/base/index.js +1 -3
- package/base/styles/createTheme.js +6 -0
- package/base/styles/mui/accordion.js +16 -0
- package/base/styles/mui/accordionDetails.js +7 -0
- package/base/styles/mui/accordionSummary.js +21 -0
- package/base/styles/mui/dataGrid.js +12 -5
- package/package.json +1 -1
- package/base/deprecated/Accordion.js +0 -45
- package/base/deprecated/AccordionDetails.js +0 -19
- package/base/deprecated/AccordionSummary.js +0 -35
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { Stack, Typography } from "@mui/material";
|
|
3
|
+
import MuiAccordionSummary from "@mui/material/AccordionSummary";
|
|
4
|
+
import { ExpandMoreIcon, NethruBulletIcon } from "./assets/icons";
|
|
5
|
+
import { grey } from "./colors";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const AccordionSummary = /*#__PURE__*/forwardRef(({
|
|
9
|
+
expandable = true,
|
|
10
|
+
subcontent,
|
|
11
|
+
children,
|
|
12
|
+
sx,
|
|
13
|
+
...props
|
|
14
|
+
}, ref) => {
|
|
15
|
+
return /*#__PURE__*/_jsx(MuiAccordionSummary, {
|
|
16
|
+
ref: ref,
|
|
17
|
+
expandIcon: expandable ? /*#__PURE__*/_jsx(ExpandMoreIcon, {
|
|
18
|
+
sx: expandMoreStyles
|
|
19
|
+
}) : undefined,
|
|
20
|
+
sx: {
|
|
21
|
+
pointerEvents: 'none',
|
|
22
|
+
...sx
|
|
23
|
+
},
|
|
24
|
+
...props,
|
|
25
|
+
children: /*#__PURE__*/_jsxs(Stack, {
|
|
26
|
+
direction: "row",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
gap: 1.5,
|
|
29
|
+
children: [/*#__PURE__*/_jsx(NethruBulletIcon, {
|
|
30
|
+
sx: bulletStyles
|
|
31
|
+
}), children, subcontent && /*#__PURE__*/_jsx(Typography, {
|
|
32
|
+
variant: "bodySmSemibold",
|
|
33
|
+
color: grey[600],
|
|
34
|
+
children: subcontent
|
|
35
|
+
})]
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
export default AccordionSummary;
|
|
40
|
+
const expandMoreStyles = {
|
|
41
|
+
pointerEvents: 'auto',
|
|
42
|
+
fontSize: 24,
|
|
43
|
+
path: {
|
|
44
|
+
fill: grey[900]
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const bulletStyles = {
|
|
48
|
+
fontSize: 18,
|
|
49
|
+
path: {
|
|
50
|
+
fill: grey[800]
|
|
51
|
+
}
|
|
52
|
+
};
|
package/base/assets/icons.js
CHANGED
|
@@ -300,6 +300,17 @@ export const CollapseIcon = createSvgIcon( /*#__PURE__*/_jsx("svg", {
|
|
|
300
300
|
fill: "#333333"
|
|
301
301
|
})
|
|
302
302
|
}), 'Collapse');
|
|
303
|
+
export const ExpandMoreIcon = createSvgIcon( /*#__PURE__*/_jsx("svg", {
|
|
304
|
+
width: "24",
|
|
305
|
+
height: "24",
|
|
306
|
+
viewBox: "0 0 24 24",
|
|
307
|
+
fill: "none",
|
|
308
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
309
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
310
|
+
d: "M7.40531 8.96412L6.35156 10.0181L12.0053 15.6719L17.6591 10.0181L16.6053 8.96412L12.0053 13.5641L7.40531 8.96412Z",
|
|
311
|
+
fill: "#7B7B7B"
|
|
312
|
+
})
|
|
313
|
+
}), 'Expand');
|
|
303
314
|
export const MonitoringIcon = createSvgIcon( /*#__PURE__*/_jsx("svg", {
|
|
304
315
|
width: "24",
|
|
305
316
|
height: "24",
|
package/base/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import globalStyles from './styles/globalStyles';
|
|
|
5
5
|
import createTheme from './styles/createTheme';
|
|
6
6
|
export { colors };
|
|
7
7
|
export { borderRadius, shadow, globalStyles, createTheme };
|
|
8
|
+
export { default as AccordionSummary } from "./AccordionSummary";
|
|
8
9
|
export { default as AddableFormList } from "./AddableFormList";
|
|
9
10
|
export { default as AlertDialog } from "./dialog/AlertDialog";
|
|
10
11
|
export { default as AppBar } from "./frame/AppBar";
|
|
@@ -32,9 +33,6 @@ export { default as Switch } from "./Switch";
|
|
|
32
33
|
export * from './frame/sidebar/SidebarContext';
|
|
33
34
|
export { default as Error } from "./error/Error";
|
|
34
35
|
export { default as HttpError } from "./error/HttpError";
|
|
35
|
-
export { default as Accordion } from "./deprecated/Accordion";
|
|
36
|
-
export { default as AccordionDetails } from "./deprecated/AccordionDetails";
|
|
37
|
-
export { default as AccordionSummary } from "./deprecated/AccordionSummary";
|
|
38
36
|
export { default as AppendableFormList } from "./deprecated/AppendableFormList";
|
|
39
37
|
export { default as AvatarDropdown } from "./deprecated/AvatarDropdown";
|
|
40
38
|
export { default as CircularProgress } from "./deprecated/CircularProgress";
|
|
@@ -2,6 +2,9 @@ import { createTheme as createMuiTheme } from "@mui/material";
|
|
|
2
2
|
import typography from "./typography";
|
|
3
3
|
import palette from "./palette";
|
|
4
4
|
import * as cssBaseline from "./mui/cssBaseline";
|
|
5
|
+
import * as accordion from "./mui/accordion";
|
|
6
|
+
import * as accordionSummary from "./mui/accordionSummary";
|
|
7
|
+
import * as accordionDetails from "./mui/accordionDetails";
|
|
5
8
|
import * as buttonBase from "./mui/buttonBase";
|
|
6
9
|
import * as icon from "./mui/icon";
|
|
7
10
|
import * as button from "./mui/button";
|
|
@@ -48,6 +51,9 @@ export default function createTheme() {
|
|
|
48
51
|
theme = createMuiTheme(theme, {
|
|
49
52
|
components: {
|
|
50
53
|
MuiCssBaseline: cssBaseline.styles,
|
|
54
|
+
MuiAccordion: accordion.styles,
|
|
55
|
+
MuiAccordionSummary: accordionSummary.styles,
|
|
56
|
+
MuiAccordionDetails: accordionDetails.styles,
|
|
51
57
|
MuiButtonBase: buttonBase.styles,
|
|
52
58
|
MuiButton: button.styles,
|
|
53
59
|
MuiToggleButton: toggleButton.styles,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { blueGrey } from "../../colors";
|
|
2
|
+
export const styles = {
|
|
3
|
+
styleOverrides: {
|
|
4
|
+
root: {
|
|
5
|
+
backgroundColor: blueGrey.contentBg,
|
|
6
|
+
boxShadow: 'none',
|
|
7
|
+
margin: '32px 0px',
|
|
8
|
+
'&.Mui-expanded': {
|
|
9
|
+
margin: '32px 0px'
|
|
10
|
+
},
|
|
11
|
+
'&:before': {
|
|
12
|
+
display: 'none'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { grey } from "../../colors";
|
|
2
|
+
import typography from "../typography";
|
|
3
|
+
export const styles = {
|
|
4
|
+
styleOverrides: {
|
|
5
|
+
root: {
|
|
6
|
+
minHeight: 42,
|
|
7
|
+
padding: '0px 0px',
|
|
8
|
+
borderBottom: `1px ${grey[300]} solid`,
|
|
9
|
+
'&.Mui-expanded': {
|
|
10
|
+
minHeight: 42
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
content: {
|
|
14
|
+
...typography.headline2,
|
|
15
|
+
margin: '0px 0px',
|
|
16
|
+
'&.Mui-expanded': {
|
|
17
|
+
margin: '0px 0px'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -67,24 +67,31 @@ export const styles = {
|
|
|
67
67
|
rowReorderCell: {
|
|
68
68
|
color: grey[700]
|
|
69
69
|
},
|
|
70
|
+
'row--editing': {
|
|
71
|
+
boxShadow: 'none'
|
|
72
|
+
},
|
|
70
73
|
cell: ({
|
|
71
74
|
ownerState
|
|
72
75
|
}) => ({
|
|
73
|
-
minHeight: '
|
|
74
|
-
paddingTop: 10,
|
|
75
|
-
paddingBottom: 10,
|
|
76
|
+
minHeight: '40px !important',
|
|
76
77
|
'&.MuiTypography-bold': {
|
|
77
78
|
fontWeight: 'bold'
|
|
78
79
|
},
|
|
79
80
|
'&.MuiTypography-greyed': {
|
|
80
81
|
color: grey[600]
|
|
81
82
|
},
|
|
82
|
-
'&:focus
|
|
83
|
+
'&:focus': {
|
|
84
|
+
outline: ownerState?.editable ? `solid ${blue[500]} 1px` : 'none'
|
|
85
|
+
},
|
|
86
|
+
'&:focus-within': {
|
|
83
87
|
outline: ownerState?.editable ? `solid ${blue[500]} 1px` : 'none'
|
|
84
88
|
},
|
|
85
89
|
'&.MuiDataGrid-cell--editing': {
|
|
86
90
|
boxShadow: 'none',
|
|
87
|
-
'&:focus
|
|
91
|
+
'&:focus': {
|
|
92
|
+
outline: `solid ${blue[500]} 1px`
|
|
93
|
+
},
|
|
94
|
+
'&:focus-within': {
|
|
88
95
|
outline: `solid ${blue[500]} 1px`
|
|
89
96
|
}
|
|
90
97
|
}
|
package/package.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import MuiAccordion from "@mui/material/Accordion";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
const styles = {
|
|
4
|
-
border: '1px solid #eaeaea',
|
|
5
|
-
boxShadow: 'none',
|
|
6
|
-
'.MuiAccordionDetails-root': {
|
|
7
|
-
pt: 0,
|
|
8
|
-
pl: 8,
|
|
9
|
-
pr: 8
|
|
10
|
-
},
|
|
11
|
-
'.MuiFormLabel-root.MuiInputLabel-root': {
|
|
12
|
-
fontSize: '14px'
|
|
13
|
-
},
|
|
14
|
-
'.MuiInputBase-input.MuiInput-input': {
|
|
15
|
-
color: '#555',
|
|
16
|
-
fontSize: '15px'
|
|
17
|
-
},
|
|
18
|
-
'.MuiTabs-root.MuiTabs-vertical': {
|
|
19
|
-
mt: 2
|
|
20
|
-
},
|
|
21
|
-
'.MuiTabs-root.MuiTabs-vertical .MuiButtonBase-root.MuiTab-root': {
|
|
22
|
-
fontSize: '14px',
|
|
23
|
-
minWidth: '32px',
|
|
24
|
-
maxWidth: '32px'
|
|
25
|
-
},
|
|
26
|
-
'.MuiButtonBase-root.MuiToggleButton-root': {
|
|
27
|
-
pt: '1px',
|
|
28
|
-
pb: '1px',
|
|
29
|
-
fontSize: '12px'
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export default function Accordion({
|
|
33
|
-
children,
|
|
34
|
-
sx,
|
|
35
|
-
...props
|
|
36
|
-
}) {
|
|
37
|
-
return /*#__PURE__*/_jsx(MuiAccordion, {
|
|
38
|
-
sx: {
|
|
39
|
-
...sx,
|
|
40
|
-
...styles
|
|
41
|
-
},
|
|
42
|
-
...props,
|
|
43
|
-
children: children
|
|
44
|
-
});
|
|
45
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import MuiAccordionDetails from "@mui/material/AccordionDetails";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
const styles = {
|
|
4
|
-
mb: 2
|
|
5
|
-
};
|
|
6
|
-
export default function AccordionDetails({
|
|
7
|
-
children,
|
|
8
|
-
sx,
|
|
9
|
-
...props
|
|
10
|
-
}) {
|
|
11
|
-
return /*#__PURE__*/_jsx(MuiAccordionDetails, {
|
|
12
|
-
sx: {
|
|
13
|
-
...sx,
|
|
14
|
-
...styles
|
|
15
|
-
},
|
|
16
|
-
...props,
|
|
17
|
-
children: children
|
|
18
|
-
});
|
|
19
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Stack, Typography } from "@mui/material";
|
|
2
|
-
import MuiAccordionSummary from "@mui/material/AccordionSummary";
|
|
3
|
-
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
-
export default function AccordionSummary({
|
|
8
|
-
title,
|
|
9
|
-
desc,
|
|
10
|
-
children,
|
|
11
|
-
...props
|
|
12
|
-
}) {
|
|
13
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
14
|
-
children: [title && /*#__PURE__*/_jsx(MuiAccordionSummary, {
|
|
15
|
-
expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
|
|
16
|
-
...props,
|
|
17
|
-
children: /*#__PURE__*/_jsxs(Stack, {
|
|
18
|
-
direction: "row",
|
|
19
|
-
alignItems: "flex-end",
|
|
20
|
-
gap: 1,
|
|
21
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
|
22
|
-
children: title
|
|
23
|
-
}), desc && /*#__PURE__*/_jsx(Typography, {
|
|
24
|
-
variant: "caption",
|
|
25
|
-
color: "#aaa",
|
|
26
|
-
children: desc
|
|
27
|
-
})]
|
|
28
|
-
})
|
|
29
|
-
}), !title && /*#__PURE__*/_jsx(MuiAccordionSummary, {
|
|
30
|
-
expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
|
|
31
|
-
...props,
|
|
32
|
-
children: children
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
35
|
-
}
|