orcs-design-system 3.3.9 → 3.3.11

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.
@@ -49,7 +49,7 @@ const panels = [{
49
49
  id: "view-options",
50
50
  iconName: "eye",
51
51
  title: "View Options",
52
- defaultExpanded: true,
52
+ expanded: true,
53
53
  content: /*#__PURE__*/_jsx(Properties, {})
54
54
  }, {
55
55
  id: "properties",
@@ -10,19 +10,20 @@ const FloatingPanels = _ref => {
10
10
  position = {
11
11
  right: 20,
12
12
  top: 20
13
- }
13
+ },
14
+ onClick = () => {}
14
15
  } = _ref;
15
16
  const [expandedPanelId, setExpandedPanelId] = useState(null);
16
-
17
- // Set the default expanded panel on component mount
18
17
  useEffect(() => {
19
- const defaultExpandedPanel = panels.find(panel => panel.defaultExpanded);
20
- if (defaultExpandedPanel) {
21
- setExpandedPanelId(defaultExpandedPanel.id);
18
+ const expandedPanel = panels.find(panel => panel.expanded);
19
+ if (expandedPanel?.id) {
20
+ setExpandedPanelId(expandedPanel.id);
22
21
  }
23
22
  }, [panels]);
24
23
  const togglePanel = panelId => {
25
- setExpandedPanelId(expandedPanelId === panelId ? null : panelId);
24
+ const selectedPanelId = expandedPanelId === panelId ? null : panelId;
25
+ onClick(selectedPanelId);
26
+ setExpandedPanelId(selectedPanelId);
26
27
  };
27
28
  return /*#__PURE__*/_jsxs(ComponentContainer, {
28
29
  containerHeight: containerHeight,
@@ -59,7 +60,8 @@ FloatingPanels.propTypes = {
59
60
  right: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
60
61
  bottom: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
61
62
  left: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
62
- })
63
+ }),
64
+ onClick: PropTypes.func
63
65
  };
64
66
  FloatingPanels.defaultProps = {
65
67
  position: {
@@ -121,6 +123,17 @@ FloatingPanels.__docgenInfo = {
121
123
  },
122
124
  "required": false
123
125
  },
126
+ "onClick": {
127
+ "defaultValue": {
128
+ "value": "() => {}",
129
+ "computed": false
130
+ },
131
+ "description": "",
132
+ "type": {
133
+ "name": "func"
134
+ },
135
+ "required": false
136
+ },
124
137
  "panels": {
125
138
  "description": "",
126
139
  "type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orcs-design-system",
3
- "version": "3.3.9",
3
+ "version": "3.3.11",
4
4
  "engines": {
5
5
  "node": "20.12.2"
6
6
  },