+
+
+
+ {navIndex !== 0 && (
+
+
+
+ )}
+ {chunkedTabs[navIndex].map((tab, index) => (
+
+ ))}
+ {hasNextNavIndex() && (
+
+
+
+ )}
+
+
+
+ {currentIndex !== false ? (
+ chunkedTabs[navIndex].map((tab, index) => (
+
+ {tab.content}
+
+ ))
+ ) : (
+ // Render if the selected tab index is outside the current rendered chunked array
+
+ {chunkedTabs[value[0]][value[1]].content}
+
+ )}
+
+ );
+};
diff --git a/plugins/catalog/src/components/CatalogPage/index.ts b/packages/core/src/components/Tabs/index.ts
similarity index 93%
rename from plugins/catalog/src/components/CatalogPage/index.ts
rename to packages/core/src/components/Tabs/index.ts
index 61182e316f..835ab5a8c3 100644
--- a/plugins/catalog/src/components/CatalogPage/index.ts
+++ b/packages/core/src/components/Tabs/index.ts
@@ -14,4 +14,4 @@
* limitations under the License.
*/
-export { default } from './CatalogPage';
+export { Tabs as default } from './Tabs';
diff --git a/packages/core/src/components/Tabs/utils.ts b/packages/core/src/components/Tabs/utils.ts
new file mode 100644
index 0000000000..3e0ab6f2c3
--- /dev/null
+++ b/packages/core/src/components/Tabs/utils.ts
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { TabProps } from './Tabs';
+
+export const chunkArray = (
+ myArray: TabProps[],
+ chunkSize: number,
+): TabProps[][] => {
+ const results = [];
+ while (myArray.length) {
+ results.push(myArray.splice(0, chunkSize));
+ }
+ return results;
+};
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index f3c5c5c778..c5749866b6 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -41,3 +41,4 @@ export * from './components/Status';
export * from './components/Button';
export * from './components/Link';
export { default as WarningPanel } from './components/WarningPanel';
+export { default as Tabs } from './components/Tabs';
diff --git a/packages/core/src/layout/Sidebar/Items.tsx b/packages/core/src/layout/Sidebar/Items.tsx
index ddd71cc189..0a875c9035 100644
--- a/packages/core/src/layout/Sidebar/Items.tsx
+++ b/packages/core/src/layout/Sidebar/Items.tsx
@@ -59,6 +59,7 @@ const useStyles = makeStyles