-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5558d98
commit 6191630
Showing
9 changed files
with
291 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React, { FC } from 'react'; | ||
import styled from '@emotion/styled'; | ||
import { Theme } from 'theme-ui'; | ||
import { | ||
Tab, | ||
Tabs as OriginalTabs, | ||
TabsProps, | ||
TabList, | ||
TabPanel, | ||
} from 'react-tabs'; | ||
|
||
const TabsContainer = styled.div` | ||
${({ theme }: { theme: Theme }) => ` | ||
.react-tabs { | ||
-webkit-tap-highlight-color: transparent; | ||
} | ||
.react-tabs__tab-list { | ||
margin: 0 0 10px; | ||
padding: 0; | ||
} | ||
.react-tabs__tab { | ||
font-size: 13px; | ||
font-weight: bold; | ||
display: inline-block; | ||
border-bottom: none; | ||
bottom: -1px; | ||
position: relative; | ||
list-style: none; | ||
padding: 4px 15px; | ||
cursor: pointer; | ||
color: ${theme?.colors?.fadedText}; | ||
} | ||
.react-tabs__tab--selected { | ||
border-bottom: 3px solid ${theme?.colors?.accent}; | ||
color: ${theme?.colors?.accent}; | ||
} | ||
.react-tabs__tab--disabled { | ||
color: GrayText; | ||
cursor: default; | ||
} | ||
.react-tabs__tab:focus { | ||
box-shadow: 0 0 5px hsl(208, 99%, 50%); | ||
border-color: hsl(208, 99%, 50%); | ||
outline: none; | ||
} | ||
.react-tabs__tab:focus:after { | ||
content: ""; | ||
position: absolute; | ||
height: 5px; | ||
left: -4px; | ||
right: -4px; | ||
bottom: -5px; | ||
background: #fff; | ||
} | ||
.react-tabs__tab-panel { | ||
display: none; | ||
} | ||
.react-tabs__tab-panel.react-tabs__tab-panel--selected { | ||
display: block; | ||
} | ||
`} | ||
`; | ||
|
||
const Tabs: FC<TabsProps> = (props: TabsProps) => ( | ||
<TabsContainer> | ||
<OriginalTabs {...props} /> | ||
</TabsContainer> | ||
); | ||
export { Tab, Tabs, TabList, TabPanel }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
integrations/storybook/.storybook/stories/controls-editors-table.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters