lecom-ui 4.6.2 → 4.6.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.
@@ -13,10 +13,7 @@ const NotificationCallout = ({ ...props }) => {
13
13
  const [lineHeight, setLineHeight] = React.useState(0);
14
14
  const refCollapse = React.useRef(null);
15
15
  const contentRef = React.useRef(null);
16
- const getIsCollapsed = React.useCallback(
17
- () => props.isCollapsed !== void 0 ? props.isCollapsed : isCollapsed,
18
- [isCollapsed, props.isCollapsed]
19
- );
16
+ const currentIsCollapsed = props.isCollapsed !== void 0 ? props.isCollapsed : isCollapsed;
20
17
  React.useEffect(() => {
21
18
  if (contentRef.current) {
22
19
  const computedStyle = window.getComputedStyle(contentRef.current);
@@ -30,17 +27,17 @@ const NotificationCallout = ({ ...props }) => {
30
27
  setShouldCollapse(shouldCollapse2);
31
28
  }, [contentHeight, lineHeight]);
32
29
  React.useEffect(() => {
33
- if (getIsCollapsed()) {
30
+ if (currentIsCollapsed) {
34
31
  refCollapse.current?.style.setProperty("transform", "rotate(180deg)");
35
32
  } else {
36
33
  refCollapse.current?.style.setProperty("transform", "rotate(0deg)");
37
34
  }
38
- }, [getIsCollapsed]);
35
+ }, [currentIsCollapsed]);
39
36
  const handleCollapse = () => {
40
37
  if (props.onCollapseChange) {
41
- props.onCollapseChange(!getIsCollapsed());
38
+ props.onCollapseChange(!currentIsCollapsed);
42
39
  } else {
43
- setIsCollapsed(!getIsCollapsed());
40
+ setIsCollapsed(!currentIsCollapsed);
44
41
  }
45
42
  };
46
43
  const defaultVariant = props.variant ?? "information";
@@ -52,16 +49,19 @@ const NotificationCallout = ({ ...props }) => {
52
49
  }
53
50
  };
54
51
  const getCollapseClass = () => {
55
- if (getIsCollapsed() && !props.title)
52
+ if (currentIsCollapsed && !props.title)
56
53
  return "max-h-6 overflow-hidden line-clamp-1";
57
- if (getIsCollapsed() && props.title) return "max-h-0 overflow-hidden";
54
+ if (currentIsCollapsed && props.title) return "max-h-0 overflow-hidden";
58
55
  return "no-collapse";
59
56
  };
60
57
  return /* @__PURE__ */ React.createElement(
61
58
  NotificationBase,
62
59
  {
63
60
  variant: defaultVariant,
64
- className: cn(getGridColumns(), getIsCollapsed() && "place-items-center"),
61
+ className: cn(
62
+ getGridColumns(),
63
+ currentIsCollapsed && "place-items-center"
64
+ ),
65
65
  dataTestId: "notification-callout"
66
66
  },
67
67
  /* @__PURE__ */ React.createElement(NotificationIcon, { variant: defaultVariant }),
@@ -73,7 +73,7 @@ const NotificationCallout = ({ ...props }) => {
73
73
  ref: contentRef,
74
74
  className: cn(
75
75
  "transition-all duration-300",
76
- getIsCollapsed() && getCollapseClass()
76
+ currentIsCollapsed && getCollapseClass()
77
77
  )
78
78
  }
79
79
  ), props.action),
package/dist/index.d.ts CHANGED
@@ -450,7 +450,7 @@ interface ErrorEmptyDisplayProps {
450
450
  render?: React.ReactNode;
451
451
  }
452
452
  declare const ErrorEmptyDisplay: {
453
- ({ className, classContent, image, title, description, footer, render, }: ErrorEmptyDisplayProps): string | number | bigint | true | React$1.JSX.Element | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined>;
453
+ ({ className, classContent, image, title, description, footer, render, }: ErrorEmptyDisplayProps): string | number | bigint | true | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | React$1.JSX.Element;
454
454
  displayName: string;
455
455
  };
456
456
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "4.6.2",
3
+ "version": "4.6.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",