@nethru/ui 2.0.1 → 2.0.2

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";
@@ -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
  },
@@ -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.2",
4
4
  "main": "base/index.js",
5
5
  "files": [
6
6
  "/base"