forked from magma/magma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Ability to set the text color with a prop + stories Reviewed By: naor9991 Differential Revision: D18084122 fbshipit-source-id: c37ebf5d553634d6b3f95fb4c82e09f6402dde43
- Loading branch information
1 parent
929bd12
commit 1837b3b
Showing
10 changed files
with
108 additions
and
19 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
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
83 changes: 83 additions & 0 deletions
83
nms/fbcnms-packages/fbcnms-ui/stories/components/text.stories.js
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,83 @@ | ||
/** | ||
* Copyright 2004-present Facebook. All Rights Reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
* @format | ||
*/ | ||
|
||
import React from 'react'; | ||
import Text from '../../components/design-system/Text.react'; | ||
import symphony from '../../theme/symphony'; | ||
import {STORY_CATEGORIES} from '../storybookUtils'; | ||
import {makeStyles} from '@material-ui/styles'; | ||
import {storiesOf} from '@storybook/react'; | ||
|
||
const useStyles = makeStyles(_theme => ({ | ||
root: { | ||
width: '100%', | ||
}, | ||
lightText: { | ||
display: 'inline-block', | ||
backgroundColor: symphony.palette.D900, | ||
}, | ||
text: { | ||
margin: '16px 0px', | ||
}, | ||
})); | ||
|
||
const TextRoot = () => { | ||
const classes = useStyles(); | ||
return ( | ||
<div className={classes.root}> | ||
<div className={classes.text}> | ||
<Text variant="body2" color="regular"> | ||
Regular Text | ||
</Text> | ||
</div> | ||
<div className={classes.text}> | ||
<div className={classes.lightText}> | ||
<Text variant="body2" color="light"> | ||
Light Text | ||
</Text> | ||
</div> | ||
</div> | ||
<div className={classes.text}> | ||
<Text variant="body2" color="primary"> | ||
Primary Text | ||
</Text> | ||
</div> | ||
<div className={classes.text}> | ||
<Text variant="body2" color="error"> | ||
Error Text | ||
</Text> | ||
</div> | ||
<div className={classes.text}> | ||
<Text variant="body2" weight="light"> | ||
Light Weight Text | ||
</Text> | ||
</div> | ||
<div className={classes.text}> | ||
<Text variant="body2" weight="regular"> | ||
Regular Weight Text | ||
</Text> | ||
</div> | ||
<div className={classes.text}> | ||
<Text variant="body2" weight="medium"> | ||
Medium Weight Text | ||
</Text> | ||
</div> | ||
<div className={classes.text}> | ||
<Text variant="body2" weight="bold"> | ||
Bold Weight Text | ||
</Text> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
storiesOf(`${STORY_CATEGORIES.COMPONENTS}`, module).add('Text', () => ( | ||
<TextRoot /> | ||
)); |
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