UNPKG

1.78 kBJavaScriptView Raw
1import PropTypes from 'prop-types'
2import styled from 'styled-components'
3import BaseQuickAddSize from './quickAddSize.base'
4
5const QuickAddSize = styled(BaseQuickAddSize)`
6 position: relative;
7 input {
8 position: absolute;
9 height: 0;
10 width: 0;
11 visibility: hidden;
12 }
13 input:checked + label {
14 background-color: ${props => props.theme.colors.navy};
15 color: ${props => props.theme.colors.white};
16 text-decoration: none;
17 &:hover {
18 background-color: ${props => props.theme.colors.navy};
19 color: ${props => props.theme.colors.white};
20 text-decoration: none;
21 }
22 }
23
24 input:disabled + label {
25 color: ${props => props.theme.colors.loading};
26 &:hover {
27 color: ${props => props.theme.colors.loading};
28 background-color: transparent;
29 cursor: not-allowed;
30 }
31 }
32
33 label {
34 box-sizing: border-box;
35 display: inline-flex;
36 justify-content: center;
37 align-items: center;
38 font-family: ${props => props.theme.fonts.primaryFont};
39 font-size: 1.4rem;
40 border-radius: 1.5rem;
41 color: $navy-blue;
42 height: 2.8rem;
43 line-height: 2.8rem;
44 margin: 0.6rem;
45 padding: 0 0.6rem;
46 min-width: 2.8rem;
47 width: auto;
48 text-decoration: none;
49
50 &:hover {
51 background-color: ${props => props.theme.colors.rocketBlue};
52 color: ${props => props.theme.colors.white};
53 cursor: pointer;
54 text-decoration: none;
55 }
56 }
57`
58
59QuickAddSize.propTypes = {
60 theme: PropTypes.shape({
61 colors: PropTypes.shape({
62 rocketBlue: PropTypes.string,
63 loading: PropTypes.string,
64 navy: PropTypes.string,
65 white: PropTypes.string
66 }),
67 fonts: PropTypes.shape({
68 primaryFont: PropTypes.string
69 })
70 })
71}
72
73/** @component */
74export default QuickAddSize