@nethru/ui 2.0.1 → 2.0.3

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/Radio.js ADDED
@@ -0,0 +1,22 @@
1
+ import { FormControlLabel } from "@mui/material";
2
+ import MuiRadio from "@mui/material/Radio";
3
+ import { forwardRef } from "react";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const Radio = /*#__PURE__*/forwardRef(({
6
+ value,
7
+ formControlLabelProps,
8
+ children,
9
+ ...props
10
+ }, ref) => {
11
+ return /*#__PURE__*/_jsx(FormControlLabel, {
12
+ ref: ref,
13
+ label: children,
14
+ value: value,
15
+ control: /*#__PURE__*/_jsx(MuiRadio, {
16
+ ...props,
17
+ color: "info"
18
+ }),
19
+ ...formControlLabelProps
20
+ });
21
+ });
22
+ export default Radio;
package/base/Select.js CHANGED
@@ -6,6 +6,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
6
6
  const Select = /*#__PURE__*/forwardRef(({
7
7
  label,
8
8
  helperText,
9
+ size,
9
10
  children,
10
11
  formControlProps,
11
12
  ...props
@@ -16,6 +17,7 @@ const Select = /*#__PURE__*/forwardRef(({
16
17
  }), [label, formControlProps]);
17
18
  return /*#__PURE__*/_jsxs(FormControl, {
18
19
  ref: ref,
20
+ size: size,
19
21
  disabled: props.disabled,
20
22
  error: props.error,
21
23
  sx: styles,
@@ -21,7 +21,7 @@ const Sidebar = /*#__PURE__*/forwardRef((props, ref) => {
21
21
  const location = useLocation();
22
22
  const navigate = useNavigate();
23
23
  const handleClick = useCallback(item => {
24
- navigate(item.href);
24
+ navigate(item.href instanceof Array ? item.href[0] : item.href);
25
25
  }, [navigate]);
26
26
  const handleToggle = useCallback(_ => {
27
27
  dispatch({
@@ -38,7 +38,7 @@
38
38
 
39
39
  .toggler {
40
40
  position: fixed;
41
- top: calc(var(--gnb-height) + 28px);
41
+ bottom: 28px;
42
42
  width: 32px;
43
43
  height: 32px;
44
44
  background-color: var(--gnb-background-color);
package/base/index.js CHANGED
@@ -21,6 +21,7 @@ export { default as Frame } from "./frame/Frame";
21
21
  export { default as MainHeader } from "./MainHeader";
22
22
  export { default as MenuItem } from "./MenuItem";
23
23
  export { default as PropertyTable } from "./PropertyTable";
24
+ export { default as Radio } from "./Radio";
24
25
  export { default as SearchableSelect } from "./SearchableSelect";
25
26
  export { default as SearchTextField } from "./SearchTextField";
26
27
  export { default as Sidebar } from "./frame/sidebar/Sidebar";
@@ -36,7 +37,6 @@ export { default as AccordionDetails } from "./deprecated/AccordionDetails";
36
37
  export { default as AccordionSummary } from "./deprecated/AccordionSummary";
37
38
  export { default as AppendableFormList } from "./deprecated/AppendableFormList";
38
39
  export { default as AvatarDropdown } from "./deprecated/AvatarDropdown";
39
- export { default as Button } from "./deprecated/Button";
40
40
  export { default as CircularProgress } from "./deprecated/CircularProgress";
41
41
  export { default as FormLabel } from "./deprecated/FormLabel";
42
42
  export { default as GroupSelect } from "./deprecated/GroupSelect";
@@ -45,9 +45,7 @@ export { default as ListItemDivider } from "./deprecated/ListItemDivider";
45
45
  export { default as ListItemGrid } from "./deprecated/ListItemGrid";
46
46
  export { default as ListItemText } from "./deprecated/ListItemText";
47
47
  export { default as ReferenceChipList } from "./deprecated/ReferenceChipList";
48
- export { default as Section } from "./deprecated/Section";
49
48
  export { default as ShadowedSection } from "./deprecated/ShadowedSection";
50
49
  export { default as StatusChip } from "./deprecated/StatusChip";
51
50
  export { default as TabbedSection } from "./deprecated/TabbedSection";
52
- export { default as Tabs } from "./deprecated/Tabs";
53
- export { default as TextField } from "./deprecated/TextField";
51
+ export { default as Tabs } from "./deprecated/Tabs";
@@ -8,6 +8,7 @@ import * as button from "./mui/button";
8
8
  import * as toggleButton from "./mui/toggleButton";
9
9
  import * as iconButton from "./mui/iconButton";
10
10
  import * as checkbox from "./mui/checkbox";
11
+ import * as radio from "./mui/radio";
11
12
  import * as switcher from "./mui/switch";
12
13
  import * as select from "./mui/select";
13
14
  import * as autocomplete from "./mui/autocomplete";
@@ -54,6 +55,7 @@ export default function createTheme() {
54
55
  MuiIcon: icon.styles,
55
56
  MuiSvgIcon: icon.styles,
56
57
  MuiCheckbox: checkbox.styles,
58
+ MuiRadio: radio.styles,
57
59
  MuiSwitch: switcher.styles,
58
60
  MuiSelect: select.styles,
59
61
  MuiAutocomplete: autocomplete.styles,
@@ -249,14 +249,14 @@ export const styles = {
249
249
  }) => ({
250
250
  minWidth: 60,
251
251
  height: ownerState.color === 'crud' ? 26 : 36,
252
- padding: ownerState.color === 'crud' ? '0px 2px' : '8px 12px',
252
+ padding: ownerState.color === 'crud' ? '0px 2px' : '8px 20px',
253
253
  fontSize: typography.bodyMdSemibold.fontSize,
254
254
  fontWeight: typography.bodyMdSemibold.fontWeight
255
255
  }),
256
256
  sizeSmall: {
257
257
  minWidth: '50px',
258
258
  height: '26px',
259
- padding: '8px 8px',
259
+ padding: '8px 12px',
260
260
  fontSize: typography.bodySmSemibold.fontSize,
261
261
  fontWeight: typography.bodySmSemibold.fontWeight
262
262
  },
@@ -70,7 +70,7 @@ export const styles = {
70
70
  cell: ({
71
71
  ownerState
72
72
  }) => ({
73
- minHeight: '40px !important',
73
+ minHeight: '45px !important',
74
74
  paddingTop: 10,
75
75
  paddingBottom: 10,
76
76
  '&.MuiTypography-bold': {
@@ -1,8 +1,13 @@
1
1
  import typography from "../typography";
2
2
  export const styles = {
3
3
  styleOverrides: {
4
- root: {
5
- fontFamily: typography.fontFamily
6
- }
4
+ root: ({
5
+ ownerState
6
+ }) => ({
7
+ fontFamily: typography.fontFamily,
8
+ '.MuiInputBase-root': {
9
+ height: ownerState.size === 'small' ? 26 : undefined
10
+ }
11
+ })
7
12
  }
8
13
  };
@@ -1,9 +1,18 @@
1
1
  import typography from "../typography";
2
+ import { grey } from "../../colors";
2
3
  export const styles = {
3
4
  styleOverrides: {
4
5
  root: {
5
6
  fontFamily: typography.fontFamily,
6
- ...typography.bodyMdMedium
7
+ ...typography.bodyMdMedium,
8
+ '.Mui-checked.Mui-disabled + .MuiFormControlLabel-label': {
9
+ color: grey[700]
10
+ }
11
+ },
12
+ label: {
13
+ '&.Mui-disabled': {
14
+ color: grey[400]
15
+ }
7
16
  }
8
17
  }
9
18
  };
@@ -0,0 +1,30 @@
1
+ import { grey } from "../../colors";
2
+ export const styles = {
3
+ styleOverrides: {
4
+ root: ({
5
+ ownerState,
6
+ theme
7
+ }) => ({
8
+ ':hover, &.Mui-focusVisible': {
9
+ backgroundColor: grey[5]
10
+ },
11
+ '&:active': {
12
+ backgroundColor: grey[10]
13
+ },
14
+ '& svg': {
15
+ fill: grey[700],
16
+ width: 18,
17
+ height: 18
18
+ },
19
+ '&.Mui-checked svg': {
20
+ fill: theme.palette.info.main
21
+ },
22
+ '&.Mui-disabled svg': {
23
+ fill: grey[400]
24
+ },
25
+ '&.Mui-disabled.Mui-checked svg': {
26
+ fill: grey[700]
27
+ }
28
+ })
29
+ }
30
+ };
@@ -4,7 +4,7 @@ export const styles = {
4
4
  minHeight: 42
5
5
  },
6
6
  flexContainer: {
7
- gap: 16
7
+ gap: 24
8
8
  },
9
9
  flexContainerVertical: ({
10
10
  ownerState,
@@ -1,6 +1,6 @@
1
1
  import typography from "../typography";
2
2
  import shadow from "../shadow";
3
- import { grey } from "../../colors";
3
+ const backgroundColor = 'rgba(101, 101, 101, 0.9)';
4
4
  export const styles = {
5
5
  defaultProps: {
6
6
  arrow: true
@@ -11,12 +11,12 @@ export const styles = {
11
11
  ...typography.bodySmMedium
12
12
  },
13
13
  tooltip: {
14
- color: grey[900],
15
- backgroundColor: '#fff',
14
+ color: '#fff',
15
+ backgroundColor: backgroundColor,
16
16
  boxShadow: shadow[4]
17
17
  },
18
18
  arrow: {
19
- color: '#fff'
19
+ color: backgroundColor
20
20
  }
21
21
  }
22
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "main": "base/index.js",
5
5
  "files": [
6
6
  "/base"
@@ -1,61 +0,0 @@
1
- import { useMemo } from "react";
2
- import MuiButton from "@mui/material/Button";
3
- import { Box, CircularProgress, IconButton } from "@mui/material";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { jsxs as _jsxs } from "react/jsx-runtime";
6
- export default function Button({
7
- label,
8
- icon,
9
- iconPlacement = 'start',
10
- iconSize = '20px',
11
- iconProps = {},
12
- progressProps = {},
13
- loading = false,
14
- ...props
15
- }) {
16
- const iconComponent = useMemo(() => {
17
- return icon ? /*#__PURE__*/_jsx(Box, {
18
- component: icon,
19
- sx: {
20
- '&.MuiSvgIcon-root': {
21
- fontSize: `${iconSize}!important`
22
- }
23
- },
24
- ...iconProps
25
- }) : null;
26
- }, [icon, iconSize, iconProps]);
27
- const startIcon = useMemo(() => {
28
- return iconPlacement === 'start' ? iconComponent : null;
29
- }, [iconComponent, iconPlacement]);
30
- const endIcon = useMemo(() => {
31
- return iconPlacement === 'end' ? iconComponent : null;
32
- }, [iconComponent, iconPlacement]);
33
- return /*#__PURE__*/_jsxs(Box, {
34
- sx: {
35
- position: 'relative',
36
- width: 'fit-content'
37
- },
38
- children: [label ? /*#__PURE__*/_jsx(MuiButton, {
39
- startIcon: startIcon,
40
- endIcon: endIcon,
41
- disabled: loading,
42
- ...props,
43
- children: label
44
- }) : /*#__PURE__*/_jsx(IconButton, {
45
- disabled: loading,
46
- ...props,
47
- children: iconComponent
48
- }), loading && /*#__PURE__*/_jsx(CircularProgress, {
49
- size: 24,
50
- thickness: 6,
51
- sx: {
52
- position: 'absolute',
53
- top: '50%',
54
- left: '50%',
55
- marginTop: '-12px',
56
- marginLeft: '-12px'
57
- },
58
- ...progressProps
59
- })]
60
- });
61
- }
@@ -1,25 +0,0 @@
1
- import MuiTextField from "@mui/material/TextField";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Fragment as _Fragment } from "react/jsx-runtime";
4
- export default function TextField({
5
- width,
6
- fontSize,
7
- textAlign,
8
- inputProps,
9
- ...props
10
- }) {
11
- const styles = {
12
- fontSize: fontSize ? fontSize : 16,
13
- textAlign: textAlign ? textAlign : 'left',
14
- width
15
- };
16
- return /*#__PURE__*/_jsx(_Fragment, {
17
- children: /*#__PURE__*/_jsx(MuiTextField, {
18
- inputProps: {
19
- ...inputProps,
20
- style: styles
21
- },
22
- ...props
23
- })
24
- });
25
- }