@nethru/ui 2.1.2 → 2.1.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.
@@ -20,6 +20,22 @@ const AddableFormList = /*#__PURE__*/forwardRef(({
20
20
  ...props
21
21
  }, ref) => {
22
22
  const removable = useMemo(() => allowEmpty || forms.length > 1, [allowEmpty, forms.length]);
23
+ const rightMargins = useMemo(() => {
24
+ const margins = [25, 30];
25
+ const counts = forms.map((form, index) => {
26
+ let count = 0;
27
+ if (!readOnly) {
28
+ if (showRemoveButton && renderButton(form, index)[0]) count++;
29
+ if (showAddButton && renderButton(form, index)[1]) count++;
30
+ }
31
+ return count;
32
+ });
33
+ const max = Math.max(...counts);
34
+ return counts.map((count, index) => {
35
+ const diff = max - count;
36
+ if (diff === 2) return margins[0] + margins[1];else if (diff === 1) return margins[count];else return 0;
37
+ });
38
+ }, [showAddButton, showRemoveButton, renderButton, forms, readOnly]);
23
39
  return /*#__PURE__*/_jsx(Stack, {
24
40
  ref: ref,
25
41
  gap: gap,
@@ -34,6 +50,7 @@ const AddableFormList = /*#__PURE__*/forwardRef(({
34
50
  alignItems: "start",
35
51
  gap: 1,
36
52
  marginTop: `${margins[index > 0 ? 1 : 0]}px`,
53
+ marginRight: `${rightMargins[index]}px`,
37
54
  children: [showRemoveButton && renderButton(form, index)[0] && /*#__PURE__*/_jsx(Tooltip, {
38
55
  title: "\uC0AD\uC81C",
39
56
  children: /*#__PURE__*/_jsx(IconButton, {
@@ -3,6 +3,7 @@
3
3
  position: relative;
4
4
  background-color: var(--frame-background-color);
5
5
  transition: width .2s;
6
+ z-index: var(--sidebar-zindex);
6
7
  }
7
8
  .container.opened {
8
9
  width: calc(var(--primary-menu-width) + var(--secondary-menu-width));
@@ -7,15 +7,16 @@ const globalStyles = {
7
7
  '--gnb-background-color': blueGrey.gnbBg,
8
8
  '--gnb-height': '64px',
9
9
  '--gnb-zindex': 1100,
10
+ '--sidebar-zindex': 1101,
10
11
  '--primary-menu-width': '72px',
11
- '--primary-menu-zindex': 1101,
12
+ '--primary-menu-zindex': 1102,
12
13
  '--secondary-menu-width': '180px',
13
14
  '--secondary-menu-collapsed-width': '30px',
14
- '--secondary-menu-zindex': 1102,
15
- '--secondary-menu-toggler-zindex': 1103,
16
- '--aside-zindex': 1104,
17
- '--aside-button-zindex': 1105,
18
- '--divider-zindex': 1106
15
+ '--secondary-menu-zindex': 1103,
16
+ '--secondary-menu-toggler-zindex': 1104,
17
+ '--aside-zindex': 1105,
18
+ '--aside-button-zindex': 1106,
19
+ '--divider-zindex': 1107
19
20
  },
20
21
  'html, body, #root': {
21
22
  margin: 0,
@@ -2,6 +2,10 @@ import { grey } from "../../colors";
2
2
  import borderRadius from "../borderRadius";
3
3
  import typography from "../typography";
4
4
  export const styles = {
5
+ defaultProps: {
6
+ variant: 'normal',
7
+ disableRipple: true
8
+ },
5
9
  variants: [{
6
10
  props: {
7
11
  variant: 'normal'
@@ -40,9 +44,6 @@ export const styles = {
40
44
  }
41
45
  }
42
46
  }],
43
- defaultProps: {
44
- variant: 'normal'
45
- },
46
47
  styleOverrides: {
47
48
  root: {
48
49
  fontFamily: typography.fontFamily,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "main": "base/index.js",
5
5
  "files": [
6
6
  "/base"