diff --git a/packages/component-faraday-ui/src/AuthorTagList.js b/packages/component-faraday-ui/src/AuthorTagList.js index 4c65fb7cfed75039882587db5e3bd37ef8b86e42..283000b2ebd028017aa3a21ba75bcdf8ec472dd7 100644 --- a/packages/component-faraday-ui/src/AuthorTagList.js +++ b/packages/component-faraday-ui/src/AuthorTagList.js @@ -8,7 +8,12 @@ const AuthorTagList = ({ authors, authorKey = 'email', separator = ',' }) => ( <Root> {authors .map(a => <AuthorTag author={a} key={a[authorKey]} />) - .reduce((prev, curr) => [prev, separator, <span> </span>, curr])} + .reduce((prev, curr) => [ + prev, + separator, + <span key={curr}> </span>, + curr, + ])} </Root> ) diff --git a/packages/component-faraday-ui/src/Text.js b/packages/component-faraday-ui/src/Text.js index ef6dc62e465b4c1054b1818af368092653eb8265..a512f96ff105ea79e31ed2cd6b850beee7197648 100644 --- a/packages/component-faraday-ui/src/Text.js +++ b/packages/component-faraday-ui/src/Text.js @@ -28,9 +28,7 @@ const fontSize = css` props.small ? th('lineHeightBaseSmall') : th('lineHeightBase')}; ` -const Text = styled.span` +export default styled.span` ${fontSize}; ${textHelper}; ` - -export default Text diff --git a/packages/hindawi-theme/package-lock.json b/packages/hindawi-theme/package-lock.json index 17b17800ea6204ee8323f164a27a50a824a02680..a5c791ad483275a8c058ac05b66755c783170125 100644 --- a/packages/hindawi-theme/package-lock.json +++ b/packages/hindawi-theme/package-lock.json @@ -1,6 +1,6 @@ { "name": "hindawi-theme", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -226,9 +226,9 @@ } }, "styled-components": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-3.4.1.tgz", - "integrity": "sha512-MvQuniHicAzeugj5A5c+cwTseVb9fGEvKesyIRNmJtv/rfgMt5PvMJBMU9ChHne7e7nZ4MIm6QFDT4QBNujVgg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-3.4.2.tgz", + "integrity": "sha512-eTmIiWstyDLccHZAyp+aCPirlkTvYiHlYGgWQxOYDv8Ko0o6mfnDo0+DnUnKinO8NzAfQXEDP7Bh0qlazwJgrw==", "requires": { "buffer": "^5.0.3", "css-to-react-native": "^2.0.3", diff --git a/packages/hindawi-theme/src/elements/Accordion.js b/packages/hindawi-theme/src/elements/Accordion.js new file mode 100644 index 0000000000000000000000000000000000000000..8668a238796d19be3f31077c73f7ecf9c04a853d --- /dev/null +++ b/packages/hindawi-theme/src/elements/Accordion.js @@ -0,0 +1,24 @@ +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')}; + `, + }, +} diff --git a/packages/hindawi-theme/src/elements/index.js b/packages/hindawi-theme/src/elements/index.js index 05d4a577fe3a2a9b8fda13fa4e6b0638d680d7c7..61399916a9c2f2426ae94fbb60fa0f05fbe51da5 100644 --- a/packages/hindawi-theme/src/elements/index.js +++ b/packages/hindawi-theme/src/elements/index.js @@ -3,7 +3,17 @@ import Menu from './Menu' import Button from './Button' import Heading from './Heading' import Checkbox from './Checkbox' +import Accordion from './Accordion' import TextField from './TextField' import ValidatedTextField from './ValidatedTextField' -export { Icon, Menu, Checkbox, Heading, Button, TextField, ValidatedTextField } +export { + Icon, + Menu, + Button, + Heading, + Checkbox, + Accordion, + TextField, + ValidatedTextField, +} diff --git a/packages/hindawi-theme/src/index.js b/packages/hindawi-theme/src/index.js index e3e98ed82bbbb5ec52fc83f5898c24c84bb69da2..3b3bd5ac5f0a8b4aacd25b6a951dda78b59b168d 100644 --- a/packages/hindawi-theme/src/index.js +++ b/packages/hindawi-theme/src/index.js @@ -9,6 +9,7 @@ import { Heading, Checkbox, TextField, + Accordion, ValidatedTextField, } from './elements' @@ -37,6 +38,13 @@ const hindawiTheme = { colorTextPlaceholder: '#595959', colorWarning: '#FC6A4B', + accordion: { + backgroundColor: '#ffffff', + headerFontSize: '16px', + headerFontFamily: "'Myriad Pro'", + border: '1px solid #dbdbdb', + }, + heading: { h1Color: '#589eb8', h2Color: '#007e92', @@ -150,6 +158,7 @@ const hindawiTheme = { Menu, Button, Checkbox, + Accordion, TextField, ValidatedTextField, },