2017-02-20 18:15:36 +02:00
|
|
|
import styled from 'styled-components';
|
|
|
|
import { Baseline } from '../../shared/composers';
|
|
|
|
import { remcalc, is } from '../../shared/functions';
|
|
|
|
import Title from './title';
|
|
|
|
import React from 'react';
|
2017-01-11 16:13:58 +02:00
|
|
|
|
2017-01-09 14:13:12 +02:00
|
|
|
const Span = styled.span`
|
2017-02-20 18:15:36 +02:00
|
|
|
display: inline-block;
|
2017-01-09 14:13:12 +02:00
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
font-weight: normal;
|
|
|
|
font-style: normal;
|
|
|
|
font-stretch: normal;
|
2017-01-12 21:04:52 +02:00
|
|
|
font-size: ${remcalc(14)};
|
2017-01-10 00:14:10 +02:00
|
|
|
|
|
|
|
justify-content: flex-end;
|
2017-02-20 18:15:36 +02:00
|
|
|
|
|
|
|
${is('collapsed')`
|
|
|
|
display: flex;
|
|
|
|
`};
|
2017-01-10 00:14:10 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledTitle = styled(Title)`
|
2017-02-20 18:15:36 +02:00
|
|
|
display: inline-block;
|
|
|
|
padding: 0 ${remcalc(18)};
|
|
|
|
|
|
|
|
${is('collapsed')`
|
|
|
|
display: flex;
|
|
|
|
padding: 0;
|
|
|
|
`};
|
2017-01-09 14:13:12 +02:00
|
|
|
`;
|
|
|
|
|
2017-02-20 18:15:36 +02:00
|
|
|
const Subtitle = ({
|
|
|
|
children,
|
|
|
|
fromHeader,
|
|
|
|
...props
|
|
|
|
}) => (
|
2017-01-10 00:14:10 +02:00
|
|
|
<StyledTitle name='list-item-subtitle' {...props}>
|
2017-02-20 18:15:36 +02:00
|
|
|
<Span fromHeader={fromHeader}>
|
|
|
|
{children}
|
2017-01-09 14:13:12 +02:00
|
|
|
</Span>
|
2017-01-10 00:14:10 +02:00
|
|
|
</StyledTitle>
|
2017-01-09 14:13:12 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
Subtitle.propTypes = {
|
2017-01-09 20:58:30 +02:00
|
|
|
children: React.PropTypes.node,
|
|
|
|
fromHeader: React.PropTypes.bool
|
2017-01-09 14:13:12 +02:00
|
|
|
};
|
|
|
|
|
2017-02-20 18:15:36 +02:00
|
|
|
export default Baseline(
|
2017-02-15 03:19:26 +02:00
|
|
|
Subtitle
|
|
|
|
);
|