2020-07-17 02:40:23 +02:00
|
|
|
import styled, { css, keyframes } from 'styled-components';
|
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
|
import { mixin } from 'shared/utils/styles';
|
2020-06-15 02:50:35 +02:00
|
|
|
import TextareaAutosize from 'react-autosize-textarea';
|
2020-07-17 02:40:23 +02:00
|
|
|
import { CheckCircle } from 'shared/icons';
|
|
|
|
import { RefObject } from 'react';
|
2020-04-10 04:40:22 +02:00
|
|
|
|
|
|
|
export const ClockIcon = styled(FontAwesomeIcon)``;
|
|
|
|
|
2020-06-15 02:50:35 +02:00
|
|
|
export const EditorTextarea = styled(TextareaAutosize)`
|
|
|
|
overflow: hidden;
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
resize: none;
|
|
|
|
height: 54px;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
background: none;
|
|
|
|
border: none;
|
|
|
|
box-shadow: none;
|
|
|
|
margin-bottom: 4px;
|
|
|
|
max-height: 162px;
|
|
|
|
min-height: 54px;
|
|
|
|
padding: 0;
|
2020-06-19 01:12:15 +02:00
|
|
|
font-size: 14px;
|
2020-07-12 09:06:11 +02:00
|
|
|
line-height: 18px;
|
2020-06-19 01:12:15 +02:00
|
|
|
color: rgba(${props => props.theme.colors.text.primary});
|
2020-06-15 02:50:35 +02:00
|
|
|
&:focus {
|
|
|
|
border: none;
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-04-10 04:40:22 +02:00
|
|
|
export const ListCardBadges = styled.div`
|
|
|
|
float: left;
|
|
|
|
display: flex;
|
|
|
|
max-width: 100%;
|
|
|
|
margin-left: -2px;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const ListCardBadge = styled.div`
|
|
|
|
color: #5e6c84;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0 6px 4px 0;
|
2020-06-15 02:50:35 +02:00
|
|
|
font-size: 12px;
|
2020-04-10 04:40:22 +02:00
|
|
|
max-width: 100%;
|
|
|
|
min-height: 20px;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
padding: 2px;
|
|
|
|
text-decoration: none;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
vertical-align: top;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const DescriptionBadge = styled(ListCardBadge)`
|
|
|
|
padding-right: 6px;
|
|
|
|
`;
|
|
|
|
|
2020-07-17 02:40:23 +02:00
|
|
|
export const DueDateCardBadge = styled(ListCardBadge)<{ isPastDue: boolean }>`
|
2020-06-15 02:50:35 +02:00
|
|
|
font-size: 12px;
|
2020-04-10 04:40:22 +02:00
|
|
|
${props =>
|
|
|
|
props.isPastDue &&
|
|
|
|
css`
|
|
|
|
padding-left: 4px;
|
|
|
|
background-color: #ec9488;
|
|
|
|
border-radius: 3px;
|
|
|
|
color: #fff;
|
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const ListCardBadgeText = styled.span`
|
|
|
|
font-size: 12px;
|
|
|
|
padding: 0 4px 0 6px;
|
|
|
|
vertical-align: top;
|
|
|
|
white-space: nowrap;
|
|
|
|
`;
|
|
|
|
|
2020-07-17 02:40:23 +02:00
|
|
|
export const ListCardContainer = styled.div<{ isActive: boolean; editable: boolean }>`
|
2020-04-10 04:40:22 +02:00
|
|
|
max-width: 256px;
|
|
|
|
margin-bottom: 8px;
|
|
|
|
border-radius: 3px;
|
|
|
|
${mixin.boxShadowCard}
|
|
|
|
cursor: pointer !important;
|
|
|
|
position: relative;
|
|
|
|
|
2020-06-15 02:50:35 +02:00
|
|
|
background-color: ${props =>
|
2020-06-16 00:36:59 +02:00
|
|
|
props.isActive && !props.editable ? mixin.darken('#262c49', 0.1) : `rgba(${props.theme.colors.bg.secondary})`};
|
2020-04-10 04:40:22 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const ListCardInnerContainer = styled.div`
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
`;
|
|
|
|
|
2020-07-17 02:40:23 +02:00
|
|
|
export const ListCardDetails = styled.div<{ complete: boolean }>`
|
2020-04-10 04:40:22 +02:00
|
|
|
overflow: hidden;
|
|
|
|
padding: 6px 8px 2px;
|
|
|
|
position: relative;
|
|
|
|
z-index: 10;
|
2020-06-19 01:12:15 +02:00
|
|
|
|
|
|
|
${props => props.complete && 'opacity: 0.6;'}
|
2020-04-10 04:40:22 +02:00
|
|
|
`;
|
|
|
|
|
2020-07-17 02:40:23 +02:00
|
|
|
const labelVariantExpandAnimation = keyframes`
|
|
|
|
0% {min-width: 40px; height: 8px;}
|
|
|
|
50% {min-width: 56px; height: 8px;}
|
|
|
|
100% {min-width: 56px; height: 16px;}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const labelTextVariantExpandAnimation = keyframes`
|
|
|
|
0% {transform: scale(0); visibility: hidden; pointer-events: none;}
|
|
|
|
75% {transform: scale(0); visibility: hidden; pointer-events: none;}
|
|
|
|
100% {transform: scale(1); visibility: visible; pointer-events: all;}
|
2020-04-10 04:40:22 +02:00
|
|
|
`;
|
|
|
|
|
2020-07-17 02:40:23 +02:00
|
|
|
const labelVariantShrinkAnimation = keyframes`
|
|
|
|
0% {min-width: 56px; height: 16px;}
|
|
|
|
50% {min-width: 56px; height: 8px;}
|
|
|
|
100% {min-width: 40px; height: 8px;}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const labelTextVariantShrinkAnimation = keyframes`
|
|
|
|
0% {transform: scale(1); visibility: visible; pointer-events: all;}
|
|
|
|
75% {transform: scale(0); visibility: hidden; pointer-events: none;}
|
|
|
|
100% {transform: scale(0); visibility: hidden; pointer-events: none;}
|
|
|
|
`;
|
|
|
|
export const ListCardLabelText = styled.span`
|
|
|
|
font-size: 12px;
|
|
|
|
font-weight: 700;
|
2020-04-10 04:40:22 +02:00
|
|
|
line-height: 16px;
|
2020-07-17 02:40:23 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const ListCardLabel = styled.span<{ variant: 'small' | 'large' }>`
|
|
|
|
${props =>
|
|
|
|
props.variant === 'small'
|
|
|
|
? css`
|
|
|
|
height: 8px;
|
|
|
|
min-width: 40px;
|
|
|
|
& ${ListCardLabelText} {
|
|
|
|
transform: scale(0);
|
|
|
|
visibility: hidden;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
`
|
|
|
|
: css`
|
|
|
|
height: 16px;
|
|
|
|
min-width: 56px;
|
|
|
|
`}
|
|
|
|
|
2020-04-10 04:40:22 +02:00
|
|
|
padding: 0 8px;
|
|
|
|
max-width: 198px;
|
|
|
|
float: left;
|
|
|
|
margin: 0 4px 4px 0;
|
|
|
|
width: auto;
|
|
|
|
border-radius: 4px;
|
|
|
|
color: #fff;
|
2020-07-17 02:40:23 +02:00
|
|
|
display: flex;
|
2020-04-10 04:40:22 +02:00
|
|
|
position: relative;
|
|
|
|
background-color: ${props => props.color};
|
|
|
|
`;
|
|
|
|
|
2020-07-17 02:40:23 +02:00
|
|
|
export const ListCardLabels = styled.div<{ toggleLabels: boolean; toggleDirection: 'expand' | 'shrink' }>`
|
|
|
|
overflow: auto;
|
|
|
|
position: relative;
|
|
|
|
&:hover {
|
|
|
|
opacity: 0.8;
|
|
|
|
}
|
|
|
|
${props =>
|
|
|
|
props.toggleLabels &&
|
|
|
|
props.toggleDirection === 'expand' &&
|
|
|
|
css`
|
|
|
|
& ${ListCardLabel} {
|
|
|
|
animation: ${labelVariantExpandAnimation} 0.45s ease-out;
|
|
|
|
}
|
|
|
|
& ${ListCardLabelText} {
|
|
|
|
animation: ${labelTextVariantExpandAnimation} 0.45s ease-out;
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
${props =>
|
|
|
|
props.toggleLabels &&
|
|
|
|
props.toggleDirection === 'shrink' &&
|
|
|
|
css`
|
|
|
|
& ${ListCardLabel} {
|
|
|
|
animation: ${labelVariantShrinkAnimation} 0.45s ease-out;
|
|
|
|
}
|
|
|
|
& ${ListCardLabelText} {
|
|
|
|
animation: ${labelTextVariantShrinkAnimation} 0.45s ease-out;
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
`;
|
2020-04-10 04:40:22 +02:00
|
|
|
export const ListCardOperation = styled.span`
|
|
|
|
display: flex;
|
|
|
|
align-content: center;
|
|
|
|
justify-content: center;
|
|
|
|
border-radius: 3px;
|
|
|
|
opacity: 0.8;
|
|
|
|
padding: 6px;
|
|
|
|
position: absolute;
|
|
|
|
right: 2px;
|
|
|
|
top: 2px;
|
2020-07-13 23:20:06 +02:00
|
|
|
z-index: 100;
|
2020-04-21 01:04:27 +02:00
|
|
|
&:hover {
|
2020-07-17 02:40:23 +02:00
|
|
|
background-color: ${props => mixin.darken('#262c49', 0.25)};
|
2020-04-21 01:04:27 +02:00
|
|
|
}
|
2020-04-10 04:40:22 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const CardTitle = styled.span`
|
|
|
|
clear: both;
|
|
|
|
margin: 0 0 4px;
|
|
|
|
overflow: hidden;
|
|
|
|
text-decoration: none;
|
|
|
|
word-wrap: break-word;
|
2020-07-12 09:06:11 +02:00
|
|
|
line-height: 18px;
|
2020-06-19 01:12:15 +02:00
|
|
|
font-size: 14px;
|
2020-06-16 00:36:59 +02:00
|
|
|
color: rgba(${props => props.theme.colors.text.primary});
|
2020-06-19 01:12:15 +02:00
|
|
|
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2020-04-10 04:40:22 +02:00
|
|
|
`;
|
2020-04-21 01:04:27 +02:00
|
|
|
|
|
|
|
export const CardMembers = styled.div`
|
|
|
|
float: right;
|
2020-06-15 02:50:35 +02:00
|
|
|
margin: 0 -2px 4px 0;
|
2020-04-21 01:04:27 +02:00
|
|
|
`;
|
2020-06-19 01:12:15 +02:00
|
|
|
|
|
|
|
export const CompleteIcon = styled(CheckCircle)`
|
|
|
|
fill: rgba(${props => props.theme.colors.success});
|
|
|
|
margin-right: 4px;
|
2020-06-24 03:16:17 +02:00
|
|
|
flex-shrink: 0;
|
2020-06-19 01:12:15 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const EditorContent = styled.div`
|
|
|
|
display: flex;
|
|
|
|
`;
|