+
+
+
+ {navIndex !== 0 && (
+
+
+
+ )}
+ {chunkedTabs[navIndex].map((tab, index) => (
+
+ ))}
+ {hasNextNavIndex() && (
+
+
+
+ )}
+
+
+
+ {chunkedTabs[navIndex].map((tab, index) => (
+
+ {tab.content}
+
+ ))}
+
+ );
+};
+
+export default Tabs;
diff --git a/packages/core/src/components/Tabs/index.ts b/packages/core/src/components/Tabs/index.ts
new file mode 100644
index 0000000000..03995fe2ea
--- /dev/null
+++ b/packages/core/src/components/Tabs/index.ts
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */
+
+export { 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..d3fa0dbd3e
--- /dev/null
+++ b/packages/core/src/components/Tabs/utils.ts
@@ -0,0 +1,42 @@
+/*
+ * 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 { useState, useEffect } from 'react';
+
+export const chunkArray = (myArray: any[], chunkSize: number) => {
+ const results = [];
+ while (myArray.length) {
+ results.push(myArray.splice(0, chunkSize));
+ }
+ return results;
+};
+
+export const useWindowWidth = () => {
+ const isClient = typeof window === 'object';
+ const getWidth = () => (isClient ? window.innerWidth : undefined);
+ const [windowWidth, setWindowWidth] = useState(getWidth);
+
+ useEffect((): any => {
+ if (!isClient) {
+ return false;
+ }
+
+ const handleResize = () => setWindowWidth(getWidth());
+
+ window.addEventListener('resize', handleResize);
+ return () => window.removeEventListener('resize', handleResize);
+ }, []);
+ return windowWidth;
+};
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 2ceea470f4..cd53075c28 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -39,3 +39,4 @@ export { default as TrendLine } from './components/TrendLine';
export { FeatureCalloutCircular } from './components/FeatureDiscovery/FeatureCalloutCircular';
export * from './components/Status';
export { default as WarningPanel } from './components/WarningPanel';
+export { default as Tabs } from './components/Tabs';
diff --git a/packages/theme/src/themes.ts b/packages/theme/src/themes.ts
index fe3c71a212..630e81c146 100644
--- a/packages/theme/src/themes.ts
+++ b/packages/theme/src/themes.ts
@@ -60,6 +60,10 @@ export const lightTheme = createTheme({
icon: '#BDBDBD',
background: '#404040',
},
+ tabbar: {
+ indicator: '#9BF0E1',
+ background: '#FFFFFF',
+ },
},
});
@@ -106,5 +110,9 @@ export const darkTheme = createTheme({
icon: '#181818',
background: '#BDBDBD',
},
+ tabbar: {
+ indicator: '#9BF0E1',
+ background: '#424242',
+ },
},
});
diff --git a/packages/theme/src/types.ts b/packages/theme/src/types.ts
index c38d67d063..8d18caf4d1 100644
--- a/packages/theme/src/types.ts
+++ b/packages/theme/src/types.ts
@@ -44,6 +44,10 @@ type PaletteAdditions = {
link: string;
gold: string;
sidebar: string;
+ tabbar: {
+ indicator: string;
+ background: string;
+ };
bursts: {
fontColor: string;
slackChannelText: string;