@elastic/eui 94.2.0 → 94.2.1

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.
@@ -95,7 +95,7 @@ export var EuiTabbedContent = /*#__PURE__*/function (_Component) {
95
95
  // Only track selection state if it's not controlled externally.
96
96
  var selectedTabId;
97
97
  if (!_selectedTab) {
98
- selectedTabId = initialSelectedTab && initialSelectedTab.id || tabs[0].id;
98
+ selectedTabId = (initialSelectedTab === null || initialSelectedTab === void 0 ? void 0 : initialSelectedTab.id) || tabs[0].id;
99
99
  }
100
100
  _this.state = {
101
101
  selectedTabId: selectedTabId,
@@ -121,10 +121,10 @@ export var EuiTabbedContent = /*#__PURE__*/function (_Component) {
121
121
  // Allow the consumer to control tab selection.
122
122
  var selectedTab = externalSelectedTab || tabs.find(function (tab) {
123
123
  return tab.id === _this2.state.selectedTabId;
124
- });
125
- var _ref = selectedTab,
126
- selectedTabContent = _ref.content,
127
- selectedTabId = _ref.id;
124
+ }) || tabs[0]; // Fall back to the first tab if a selected tab can't be found
125
+
126
+ var selectedTabContent = selectedTab.content,
127
+ selectedTabId = selectedTab.id;
128
128
  return ___EmotionJSX("div", _extends({
129
129
  className: className
130
130
  }, rest), ___EmotionJSX(EuiTabs, {
@@ -103,7 +103,7 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
103
103
  // Only track selection state if it's not controlled externally.
104
104
  var selectedTabId;
105
105
  if (!_selectedTab) {
106
- selectedTabId = initialSelectedTab && initialSelectedTab.id || tabs[0].id;
106
+ selectedTabId = (initialSelectedTab === null || initialSelectedTab === void 0 ? void 0 : initialSelectedTab.id) || tabs[0].id;
107
107
  }
108
108
  _this.state = {
109
109
  selectedTabId: selectedTabId,
@@ -129,10 +129,10 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
129
129
  // Allow the consumer to control tab selection.
130
130
  var selectedTab = externalSelectedTab || tabs.find(function (tab) {
131
131
  return tab.id === _this2.state.selectedTabId;
132
- });
133
- var _ref = selectedTab,
134
- selectedTabContent = _ref.content,
135
- selectedTabId = _ref.id;
132
+ }) || tabs[0]; // Fall back to the first tab if a selected tab can't be found
133
+
134
+ var selectedTabContent = selectedTab.content,
135
+ selectedTabId = selectedTab.id;
136
136
  return (0, _react2.jsx)("div", _extends({
137
137
  className: className
138
138
  }, rest), (0, _react2.jsx)(_tabs.EuiTabs, {
@@ -88,7 +88,7 @@ export var EuiTabbedContent = /*#__PURE__*/function (_Component) {
88
88
  // Only track selection state if it's not controlled externally.
89
89
  var selectedTabId;
90
90
  if (!_selectedTab) {
91
- selectedTabId = initialSelectedTab && initialSelectedTab.id || tabs[0].id;
91
+ selectedTabId = (initialSelectedTab === null || initialSelectedTab === void 0 ? void 0 : initialSelectedTab.id) || tabs[0].id;
92
92
  }
93
93
  _this.state = {
94
94
  selectedTabId: selectedTabId,
@@ -114,10 +114,10 @@ export var EuiTabbedContent = /*#__PURE__*/function (_Component) {
114
114
  // Allow the consumer to control tab selection.
115
115
  var selectedTab = externalSelectedTab || tabs.find(function (tab) {
116
116
  return tab.id === _this2.state.selectedTabId;
117
- });
118
- var _ref = selectedTab,
119
- selectedTabContent = _ref.content,
120
- selectedTabId = _ref.id;
117
+ }) || tabs[0]; // Fall back to the first tab if a selected tab can't be found
118
+
119
+ var selectedTabContent = selectedTab.content,
120
+ selectedTabId = selectedTab.id;
121
121
  return ___EmotionJSX("div", _extends({
122
122
  className: className
123
123
  }, rest), ___EmotionJSX(EuiTabs, {
@@ -97,7 +97,7 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
97
97
  // Only track selection state if it's not controlled externally.
98
98
  var selectedTabId;
99
99
  if (!_selectedTab) {
100
- selectedTabId = initialSelectedTab && initialSelectedTab.id || tabs[0].id;
100
+ selectedTabId = (initialSelectedTab === null || initialSelectedTab === void 0 ? void 0 : initialSelectedTab.id) || tabs[0].id;
101
101
  }
102
102
  _this.state = {
103
103
  selectedTabId: selectedTabId,
@@ -123,10 +123,10 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
123
123
  // Allow the consumer to control tab selection.
124
124
  var selectedTab = externalSelectedTab || tabs.find(function (tab) {
125
125
  return tab.id === _this2.state.selectedTabId;
126
- });
127
- var _ref = selectedTab,
128
- selectedTabContent = _ref.content,
129
- selectedTabId = _ref.id;
126
+ }) || tabs[0]; // Fall back to the first tab if a selected tab can't be found
127
+
128
+ var selectedTabContent = selectedTab.content,
129
+ selectedTabId = selectedTab.id;
130
130
  return (0, _react2.jsx)("div", (0, _extends2.default)({
131
131
  className: className
132
132
  }, rest), (0, _react2.jsx)(_tabs.EuiTabs, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "94.2.0",
4
+ "version": "94.2.1",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -60,7 +60,6 @@
60
60
  ],
61
61
  "dependencies": {
62
62
  "@hello-pangea/dnd": "^16.6.0",
63
- "@storybook/test": "^8.0.5",
64
63
  "@types/lodash": "^4.14.202",
65
64
  "@types/numeral": "^2.0.5",
66
65
  "@types/react-window": "^1.8.8",
@@ -127,6 +126,7 @@
127
126
  "@storybook/blocks": "^8.0.5",
128
127
  "@storybook/react": "^8.0.5",
129
128
  "@storybook/react-webpack5": "^8.0.5",
129
+ "@storybook/test": "^8.0.5",
130
130
  "@svgr/core": "8.0.0",
131
131
  "@svgr/plugin-jsx": "^8.0.1",
132
132
  "@svgr/plugin-svgo": "^8.0.1",
@@ -98,7 +98,7 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
98
98
  // Only track selection state if it's not controlled externally.
99
99
  var selectedTabId;
100
100
  if (!_selectedTab) {
101
- selectedTabId = initialSelectedTab && initialSelectedTab.id || tabs[0].id;
101
+ selectedTabId = (initialSelectedTab === null || initialSelectedTab === void 0 ? void 0 : initialSelectedTab.id) || tabs[0].id;
102
102
  }
103
103
  _this.state = {
104
104
  selectedTabId: selectedTabId,
@@ -124,10 +124,10 @@ var EuiTabbedContent = /*#__PURE__*/function (_Component) {
124
124
  // Allow the consumer to control tab selection.
125
125
  var selectedTab = externalSelectedTab || tabs.find(function (tab) {
126
126
  return tab.id === _this2.state.selectedTabId;
127
- });
128
- var _ref = selectedTab,
129
- selectedTabContent = _ref.content,
130
- selectedTabId = _ref.id;
127
+ }) || tabs[0]; // Fall back to the first tab if a selected tab can't be found
128
+
129
+ var selectedTabContent = selectedTab.content,
130
+ selectedTabId = selectedTab.id;
131
131
  return (0, _react2.jsx)("div", (0, _extends2.default)({
132
132
  className: className
133
133
  }, rest), (0, _react2.jsx)(_tabs.EuiTabs, {