From 31d07fdac80a2a546646b1eb232fa7dd6319ce83 Mon Sep 17 00:00:00 2001
From: August Skare <post@augustskare.no>
Date: Mon, 19 Nov 2018 17:27:00 +0100
Subject: rename all files and directories to lowercase

---
 packages/dev-tools-pages/ts/components/tabs.tsx | 64 +++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 packages/dev-tools-pages/ts/components/tabs.tsx

(limited to 'packages/dev-tools-pages/ts/components/tabs.tsx')

diff --git a/packages/dev-tools-pages/ts/components/tabs.tsx b/packages/dev-tools-pages/ts/components/tabs.tsx
new file mode 100644
index 000000000..0a62fa334
--- /dev/null
+++ b/packages/dev-tools-pages/ts/components/tabs.tsx
@@ -0,0 +1,64 @@
+import * as React from 'react';
+import { Tab, TabList, TabPanel, Tabs as ReactTabs } from 'react-tabs';
+import styled from 'styled-components';
+
+import { colors } from 'ts/variables';
+
+import { Breakout } from './Breakout';
+
+const StyledTabList = styled(TabList)`
+    text-transform: uppercase;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    overflow: hidden;
+`;
+
+const StyledTab = styled(Tab)`
+    background-color: ${props => props.theme.colors.secondary};
+    height: 2.5rem;
+    padding-left: 1rem;
+    padding-right: 1rem;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    float: left;
+    &:not(:first-of-type) {
+        margin-left: 0.25rem;
+    }
+
+    &[aria-selected='true'] {
+        background-color: ${colors.gray};
+    }
+
+    &[aria-selected='false']:focus,
+    &[aria-selected='false']:hover {
+        background-color: ${props => props.theme.colors.secondary_alt};
+        cursor: pointer;
+    }
+`;
+
+const Tabs: React.StatelessComponent<{}> = props => (
+    <Breakout>
+        <ReactTabs>
+            <StyledTabList>
+                {React.Children.map(props.children, child => {
+                    const { title } = React.cloneElement(child as React.ReactElement<any>).props;
+                    return <StyledTab>{title}</StyledTab>;
+                })}
+            </StyledTabList>
+
+            {React.Children.map(props.children, child => <TabPanel>{child}</TabPanel>)}
+        </ReactTabs>
+    </Breakout>
+);
+
+interface TabBlockProps {
+    title: string;
+}
+
+const TabBlock: React.StatelessComponent<TabBlockProps> = props => <React.Fragment>{props.children}</React.Fragment>;
+
+const ContextTabs = Tabs;
+
+export { ContextTabs as Tabs, TabBlock };
-- 
cgit v1.2.3

