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

feat(styleguide): override accordion component

parent d070582f
No related branches found
No related tags found
1 merge request!43Sprint #19
...@@ -8,7 +8,12 @@ const AuthorTagList = ({ authors, authorKey = 'email', separator = ',' }) => ( ...@@ -8,7 +8,12 @@ const AuthorTagList = ({ authors, authorKey = 'email', separator = ',' }) => (
<Root> <Root>
{authors {authors
.map(a => <AuthorTag author={a} key={a[authorKey]} />) .map(a => <AuthorTag author={a} key={a[authorKey]} />)
.reduce((prev, curr) => [prev, separator, <span>&nbsp;</span>, curr])} .reduce((prev, curr) => [
prev,
separator,
<span key={curr}>&nbsp;</span>,
curr,
])}
</Root> </Root>
) )
......
...@@ -28,9 +28,7 @@ const fontSize = css` ...@@ -28,9 +28,7 @@ const fontSize = css`
props.small ? th('lineHeightBaseSmall') : th('lineHeightBase')}; props.small ? th('lineHeightBaseSmall') : th('lineHeightBase')};
` `
const Text = styled.span` export default styled.span`
${fontSize}; ${fontSize};
${textHelper}; ${textHelper};
` `
export default Text
{ {
"name": "hindawi-theme", "name": "hindawi-theme",
"version": "1.0.0", "version": "1.0.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
...@@ -226,9 +226,9 @@ ...@@ -226,9 +226,9 @@
} }
}, },
"styled-components": { "styled-components": {
"version": "3.4.1", "version": "3.4.2",
"resolved": "https://registry.npmjs.org/styled-components/-/styled-components-3.4.1.tgz", "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-3.4.2.tgz",
"integrity": "sha512-MvQuniHicAzeugj5A5c+cwTseVb9fGEvKesyIRNmJtv/rfgMt5PvMJBMU9ChHne7e7nZ4MIm6QFDT4QBNujVgg==", "integrity": "sha512-eTmIiWstyDLccHZAyp+aCPirlkTvYiHlYGgWQxOYDv8Ko0o6mfnDo0+DnUnKinO8NzAfQXEDP7Bh0qlazwJgrw==",
"requires": { "requires": {
"buffer": "^5.0.3", "buffer": "^5.0.3",
"css-to-react-native": "^2.0.3", "css-to-react-native": "^2.0.3",
......
import { css } from 'styled-components'
import { th } from '@pubsweet/ui-toolkit'
export default {
Root: css`
background-color: ${th('accordion.backgroundColor')};
border-radius: ${th('borderRadius')};
box-shadow: ${th('boxShadow')};
`,
Header: {
Root: css`
border-bottom: ${props =>
props.expanded ? th('accordion.border') : 'none'};
`,
Label: css`
color: ${th('colorText')};
font-size: ${th('accordion.headerFontSize')};
font-family: ${th('accordion.headerFontFamily')};
`,
Icon: css`
color: ${th('colorText')};
`,
},
}
...@@ -3,7 +3,17 @@ import Menu from './Menu' ...@@ -3,7 +3,17 @@ import Menu from './Menu'
import Button from './Button' import Button from './Button'
import Heading from './Heading' import Heading from './Heading'
import Checkbox from './Checkbox' import Checkbox from './Checkbox'
import Accordion from './Accordion'
import TextField from './TextField' import TextField from './TextField'
import ValidatedTextField from './ValidatedTextField' import ValidatedTextField from './ValidatedTextField'
export { Icon, Menu, Checkbox, Heading, Button, TextField, ValidatedTextField } export {
Icon,
Menu,
Button,
Heading,
Checkbox,
Accordion,
TextField,
ValidatedTextField,
}
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
Heading, Heading,
Checkbox, Checkbox,
TextField, TextField,
Accordion,
ValidatedTextField, ValidatedTextField,
} from './elements' } from './elements'
...@@ -37,6 +38,13 @@ const hindawiTheme = { ...@@ -37,6 +38,13 @@ const hindawiTheme = {
colorTextPlaceholder: '#595959', colorTextPlaceholder: '#595959',
colorWarning: '#FC6A4B', colorWarning: '#FC6A4B',
accordion: {
backgroundColor: '#ffffff',
headerFontSize: '16px',
headerFontFamily: "'Myriad Pro'",
border: '1px solid #dbdbdb',
},
heading: { heading: {
h1Color: '#589eb8', h1Color: '#589eb8',
h2Color: '#007e92', h2Color: '#007e92',
...@@ -150,6 +158,7 @@ const hindawiTheme = { ...@@ -150,6 +158,7 @@ const hindawiTheme = {
Menu, Menu,
Button, Button,
Checkbox, Checkbox,
Accordion,
TextField, TextField,
ValidatedTextField, ValidatedTextField,
}, },
......
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