@nethru/ui 2.0.4 → 2.0.6

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.
@@ -13,6 +13,9 @@ const AddableFormList = /*#__PURE__*/forwardRef(({
13
13
  readOnly,
14
14
  gap = 2,
15
15
  margins = [5, 5],
16
+ showAddButton = true,
17
+ showRemoveButton = true,
18
+ allowEmpty = false,
16
19
  ...props
17
20
  }, ref) => {
18
21
  return /*#__PURE__*/_jsx(Stack, {
@@ -29,20 +32,28 @@ const AddableFormList = /*#__PURE__*/forwardRef(({
29
32
  alignItems: "start",
30
33
  gap: 1,
31
34
  marginTop: `${margins[index > 0 ? 1 : 0]}px`,
32
- children: [/*#__PURE__*/_jsx(Tooltip, {
35
+ children: [showRemoveButton && /*#__PURE__*/_jsx(Tooltip, {
33
36
  title: "\uC0AD\uC81C",
34
37
  children: /*#__PURE__*/_jsx(IconButton, {
35
- color: "crud",
38
+ variant: "menu",
36
39
  onClick: _ => onRemove(index),
37
- disabled: forms.length === 1,
38
- children: /*#__PURE__*/_jsx(RemoveIcon, {})
40
+ disabled: !allowEmpty && forms.length === 1,
41
+ children: /*#__PURE__*/_jsx(RemoveIcon, {
42
+ sx: {
43
+ fontSize: 17
44
+ }
45
+ })
39
46
  })
40
- }), /*#__PURE__*/_jsx(Tooltip, {
47
+ }), showAddButton && /*#__PURE__*/_jsx(Tooltip, {
41
48
  title: "\uCD94\uAC00",
42
49
  children: /*#__PURE__*/_jsx(IconButton, {
43
- color: "crud",
50
+ variant: "menu",
44
51
  onClick: _ => onAdd(index),
45
- children: /*#__PURE__*/_jsx(AddIcon, {})
52
+ children: /*#__PURE__*/_jsx(AddIcon, {
53
+ sx: {
54
+ fontSize: 17
55
+ }
56
+ })
46
57
  })
47
58
  })]
48
59
  })]
@@ -15,8 +15,8 @@ const ColumnedSection = /*#__PURE__*/forwardRef(({
15
15
  const point = Math.floor(12 / columns);
16
16
  if (columns <= 3) {
17
17
  return {
18
- xs: 12,
19
- sm: point
18
+ sm: 12,
19
+ md: point
20
20
  };
21
21
  }
22
22
  return {
@@ -14,6 +14,7 @@ const SearchableSelect = /*#__PURE__*/forwardRef(({
14
14
  labelKey = 'label',
15
15
  groupKey,
16
16
  error,
17
+ fullWidth,
17
18
  formControlProps,
18
19
  textFieldProps,
19
20
  ...props
@@ -37,6 +38,7 @@ const SearchableSelect = /*#__PURE__*/forwardRef(({
37
38
  disabled: props.disabled,
38
39
  error: error,
39
40
  sx: styles,
41
+ fullWidth: fullWidth,
40
42
  ...formControlProps,
41
43
  children: [label && /*#__PURE__*/_jsx(InputLabel, {
42
44
  disabled: props.disabled,
package/base/Select.js CHANGED
@@ -7,6 +7,7 @@ const Select = /*#__PURE__*/forwardRef(({
7
7
  label,
8
8
  helperText,
9
9
  size,
10
+ fullWidth,
10
11
  children,
11
12
  formControlProps,
12
13
  ...props
@@ -21,6 +22,7 @@ const Select = /*#__PURE__*/forwardRef(({
21
22
  disabled: props.disabled,
22
23
  error: props.error,
23
24
  sx: styles,
25
+ fullWidth: fullWidth,
24
26
  ...formControlProps,
25
27
  children: [label && /*#__PURE__*/_jsx(InputLabel, {
26
28
  children: label
package/base/Switch.js CHANGED
@@ -10,6 +10,7 @@ const Switch = /*#__PURE__*/forwardRef(({
10
10
  return /*#__PURE__*/_jsx(FormControlLabel, {
11
11
  ref: ref,
12
12
  label: label,
13
+ labelPlacement: "start",
13
14
  control: /*#__PURE__*/_jsx(MuiSwitch, {
14
15
  ...props,
15
16
  color: "info"
@@ -19,7 +19,8 @@ const globalStyles = {
19
19
  },
20
20
  body: {
21
21
  fontFamily: typography.fontFamily,
22
- backgroundColor: blueGrey.contentBg
22
+ backgroundColor: blueGrey.contentBg,
23
+ minWidth: '1280px'
23
24
  },
24
25
  code: {
25
26
  fontFamily: typography.fontFamily
@@ -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 20px',
252
+ padding: ownerState.color === 'crud' ? '4px 6px' : '8px 12px',
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 12px',
259
+ padding: '8px 8px',
260
260
  fontSize: typography.bodySmSemibold.fontSize,
261
261
  fontWeight: typography.bodySmSemibold.fontWeight
262
262
  },
@@ -10,6 +10,7 @@ export const styles = {
10
10
  }
11
11
  },
12
12
  label: {
13
+ // whiteSpace: 'nowrap',
13
14
  '&.Mui-disabled': {
14
15
  color: grey[400]
15
16
  }
@@ -1,6 +1,9 @@
1
1
  import { grey } from "../../colors";
2
2
  import borderRadius from "../borderRadius";
3
3
  export const styles = {
4
+ defaultProps: {
5
+ columnSpacing: 5
6
+ },
4
7
  styleOverrides: {
5
8
  item: {
6
9
  '.MuiGrid-box': {
@@ -27,7 +27,7 @@ export const styles = {
27
27
  },
28
28
  style: {
29
29
  '&': {
30
- backgroundColor: undefined,
30
+ backgroundColor: grey[5],
31
31
  borderRadius: borderRadius[2],
32
32
  '&:active': {
33
33
  backgroundColor: grey[10],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "main": "base/index.js",
5
5
  "files": [
6
6
  "/base"