1 | import React from 'react'
|
2 | import PropTypes from 'prop-types'
|
3 | import styled, { css } from 'styled-components'
|
4 |
|
5 | import { theme } from 'SRC/core/theme'
|
6 |
|
7 | const inline = css`
|
8 | flex-direction: row;
|
9 | > li {
|
10 | margin-left: 2rem;
|
11 | margin-right: 0.5rem;
|
12 | &:last-of-type {
|
13 | margin-right: 0;
|
14 | }
|
15 | }
|
16 | `
|
17 |
|
18 | const UL = styled(({className, children}) => {
|
19 | return (
|
20 | <ul className={className}>
|
21 | {children}
|
22 | </ul>
|
23 | )
|
24 | })`
|
25 | display: flex;
|
26 | ${props => props.inline ? inline : `flex-direction: column;`}
|
27 | color: ${props => props.color};
|
28 | ${props => props.image ? `list-style-image: url(${props.image});` : ''}
|
29 | ${props => props.leftPad ? `padding-left: ${props.leftPad}` : ''}
|
30 | list-style-type: ${props => props.type};
|
31 | list-style-position: ${props => props.outside ? 'outside' : 'inside'};
|
32 | font-size: ${props => props.fontSize};
|
33 | ${props => (props.direction === 'row') }
|
34 | > li {
|
35 | height: ${props => props.itemHeight};
|
36 | }
|
37 | `
|
38 |
|
39 | UL.propTypes = {
|
40 | color: PropTypes.string,
|
41 | itemHeight: PropTypes.string,
|
42 | inline: PropTypes.bool,
|
43 | image: PropTypes.string,
|
44 | fontSize: PropTypes.string,
|
45 | leftPad: PropTypes.string,
|
46 | outside: PropTypes.bool,
|
47 | type: PropTypes.string
|
48 | }
|
49 |
|
50 | UL.defaultProps = {
|
51 | color: theme.colors.rocketBlue,
|
52 | itemHeight: 'auto',
|
53 | fontSize: '1.6rem',
|
54 | leftPad: '4rem',
|
55 | outside: true,
|
56 | type: 'disc'
|
57 | }
|
58 |
|
59 |
|
60 | export default UL
|