Skip to content
Snippets Groups Projects
Commit c41bb16a authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

feat(faraday-ui): text component

parent 280f28d8
No related branches found
No related tags found
1 merge request!43Sprint #19
{
"name": "component-faraday-ui",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@pubsweet/ui": "^8.3.0",
"@pubsweet/ui-toolkit": "^1.2.0",
"react": "^16.4.2",
"styled-components": "^3.4.2"
}
}
import { th } from '@pubsweet/ui-toolkit'
import styled, { css } from 'styled-components'
const fontSize = css`
color: ${props => (props.secondary ? th('colorSecondary') : th('colorText'))};
font-size: ${props =>
props.small ? th('fontSizeBaseSmall') : th('fontSizeBase')};
line-height: ${props =>
props.small ? th('lineHeightBaseSmall') : th('lineHeightBase')};
`
const Text = styled.span`
font-family: ${th('fontReading')};
${fontSize};
`
export default Text
A piece of text. (Body 1)
```js
<Text>my boy is amazing</Text>
```
A secondary text. (Body 2)
```js
<Text secondary>my boy is amazing</Text>
```
A small text.
```js
<Text small>my boy is amazing</Text>
```
A small secondary text.
```js
<Text small secondary>my boy is amazing</Text>
```
......@@ -7,7 +7,11 @@ const path = require('path')
// const nodeExternals = require('webpack-node-externals')
module.exports = dir => {
const include = [path.join(dir, 'src'), /@pubsweet\/[^/]+\/src/]
const include = [
path.join(dir, 'src'),
/@pubsweet\/[^/]+\/src/,
/component-faraday-ui\/src/,
]
return {
devtool: 'cheap-module-source-map',
entry: './src/index.js',
......
const path = require('path')
module.exports = {
components: ['src/components/**/*.js', '../component-faraday-ui/src/**/*.js'],
styleguideComponents: {
Wrapper: path.join(__dirname, 'src/config/Wrapper'),
},
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment