lecom-ui 4.6.9 → 4.7.0

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.
@@ -6,8 +6,9 @@ import { NotificationContent } from './NotificationContent.js';
6
6
  import { NotificationIcon } from './NotificationIcon.js';
7
7
 
8
8
  const NotificationCallout = ({ ...props }) => {
9
- const defaultCollapsed = props.defaultCollapsed ?? false;
10
- const [isCollapsed, setIsCollapsed] = React.useState(defaultCollapsed);
9
+ const [isCollapsed, setIsCollapsed] = React.useState(
10
+ !!props.defaultCollapsed
11
+ );
11
12
  const [shouldCollapse, setShouldCollapse] = React.useState(false);
12
13
  const [contentHeight, setContentHeight] = React.useState(0);
13
14
  const [lineHeight, setLineHeight] = React.useState(0);
@@ -37,9 +38,12 @@ const NotificationCallout = ({ ...props }) => {
37
38
  }
38
39
  }, [isCollapsed]);
39
40
  const handleCollapse = () => {
40
- console.log("handleCollapse", !isCollapsed);
41
- props.onCollapseChange?.(!isCollapsed);
42
- setIsCollapsed(!isCollapsed);
41
+ if (props.onCollapseChange) {
42
+ console.log("onCollapseChange", !isCollapsed);
43
+ props.onCollapseChange?.(!isCollapsed);
44
+ } else {
45
+ setIsCollapsed(!isCollapsed);
46
+ }
43
47
  };
44
48
  const defaultVariant = props.variant ?? "information";
45
49
  const getGridColumns = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "4.6.9",
3
+ "version": "4.7.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",