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

feat(styleguide): steps override

parent 668a34ad
No related branches found
No related tags found
1 merge request!43Sprint #19
import React from 'react'
import { Steps } from '@pubsweet/ui'
export default () => (
<Steps currentStep={1}>
<Steps.Step key="step-1" title="Previous" />
<Steps.Step key="step-2" title="Current step" />
<Steps.Step key="step-3" title="Next step" />
</Steps>
)
Submission steps.
```js
<Steps />
```
\ No newline at end of file
/* eslint-disable no-nested-ternary */
import { css } from 'styled-components'
import { th } from '@pubsweet/ui-toolkit'
const checkIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24">
<path fill="#fff" d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/>
</svg>`
export default {
Step: css`
height: 20px;
width: 20px;
box-sizing: border-box;
border: ${props =>
props.isPast
? 'none'
: props.isCurrent ? '6px solid #dbdbdb' : '2px solid #dbdbdb'};
background-color: ${props =>
!props.isCurrent && !props.isPast
? th('colorBackground')
: 'transparent'};
z-index: 10;
`,
Separator: css`
background-color: ${props =>
props.isPast ? th('colorPrimary') : th('colorBorder')};
margin: 0 -2px;
z-index: 1;
`,
Bullet: css`
background-color: ${th('colorPrimary')};
width: 8px;
height: 8px;
`,
Success: css`
background: url('data:image/svg+xml;utf8,${encodeURIComponent(
checkIcon,
)}') center no-repeat, ${th('colorPrimary')};
`,
StepTitle: css`
color: ${props =>
props.isCurrent ? th('steps.currentStepColor') : th('colorText')};
font-family: ${props =>
props.isCurrent ? th('fontHeading') : th('fontReading')};
font-size: ${th('fontSizeBase')};
line-height: ${th('lineHeightBase')};
`,
}
import Icon from './Icon'
import Menu from './Menu'
import Steps from './Steps'
import Button from './Button'
import Heading from './Heading'
import Checkbox from './Checkbox'
......@@ -10,6 +11,7 @@ import ValidatedTextField from './ValidatedTextField'
export {
Icon,
Menu,
Steps,
Button,
Heading,
Checkbox,
......
......@@ -5,6 +5,7 @@ import './fonts/index.css'
import {
Icon,
Menu,
Steps,
Button,
Heading,
Checkbox,
......@@ -104,6 +105,10 @@ const hindawiTheme = {
hoverShadow: '0 1px 2px 1px #939393',
},
steps: {
currentStepColor: '#003049',
},
/* Text variables */
// fonts
fontInterface: "'Myriad Pro Bold'",
......@@ -157,6 +162,7 @@ const hindawiTheme = {
{
Icon,
Menu,
Steps,
Button,
Checkbox,
Accordion,
......
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