-
Notifications
You must be signed in to change notification settings - Fork 11
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
Andrei Firsov
committed
Aug 13, 2019
1 parent
2b83d76
commit 325c182
Showing
8 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+4.21 KB
e2e/__tests__/__image_snapshots__/tab-test-js-components-tab-common-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,12 @@ | ||
import { baisy } from '../setup/TestSuiter'; | ||
|
||
|
||
const SUITES = [ | ||
baisy.suite('Components/Tab', 'common'), | ||
]; | ||
|
||
|
||
SUITES.map(suite => { | ||
it(suite.getTestName(), suite.testStory, 20000); | ||
}); | ||
|
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,19 @@ | ||
// @flow | ||
|
||
import React from 'react'; | ||
|
||
import { TabOuter } from './Tab.theme'; | ||
|
||
type TabProps = { | ||
children: React$Node, | ||
className?: string, | ||
}; | ||
|
||
const Tab = ({ children, ...rest }: TabProps) => ( | ||
<TabOuter { ...rest }> | ||
{ children } | ||
</TabOuter> | ||
); | ||
|
||
export { Tab }; | ||
|
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,22 @@ | ||
// @flow | ||
|
||
import React from 'react'; | ||
import { css } from 'react-emotion'; | ||
|
||
export default (asStory: *) => { | ||
asStory('Components/Tab', module, (story, { Tab, Row }) => { | ||
story | ||
.add('common', () => ( | ||
<div className={ css`background-color: #F4F7F9` }> | ||
<Row gap="xs" offsetX="lg" offsetY="lg"> | ||
<Tab tagName="div" className="active"> | ||
Active Tab | ||
</Tab> | ||
<Tab tagName="div"> | ||
Inactive Tab | ||
</Tab> | ||
</Row> | ||
</div> | ||
)); | ||
}); | ||
}; |
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,34 @@ | ||
import { createThemeTag } from '../../theme/createThemeTag'; | ||
|
||
const name = 'tab'; | ||
|
||
const [TabOuter, themeTabOuter] = createThemeTag(name, () => ({ | ||
root: { | ||
display: 'inline-flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
height: '32px', | ||
padding: '6px 12px', | ||
fontSize: '14px', | ||
lineHeight: '20px', | ||
color: '#323C47', | ||
borderRadius: '5px 5px 0 0', | ||
backgroundColor: '#FFFFFF', | ||
cursor: 'pointer', | ||
|
||
'&:not(.active)': { | ||
opacity: 0.7, | ||
borderRadius: '5px 5px 0 0', | ||
}, | ||
}, | ||
})); | ||
|
||
const theme = { | ||
...themeTabOuter, | ||
}; | ||
|
||
export { | ||
TabOuter, | ||
theme, | ||
}; | ||
|
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,5 @@ | ||
// @flow | ||
|
||
export { Tab } from './Tab'; | ||
export { theme } from './Tab.theme'; | ||
|
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