-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReportDataEntry.styles.tsx
94 lines (83 loc) · 3.19 KB
/
ReportDataEntry.styles.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Recidiviz - a data platform for criminal justice reform
// Copyright (C) 2024 Recidiviz, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =============================================================================
import {
HEADER_BAR_HEIGHT,
MIN_DESKTOP_WIDTH,
palette,
typography,
} from "@justice-counts/common/components/GlobalStyles";
import React from "react";
import styled from "styled-components/macro";
export const SIDE_PANEL_WIDTH = 360;
export const CONFIRMATION_DIALOGUE_SIDE_PANEL_WIDTH = 295;
export const DATA_ENTRY_WIDTH = 644;
export const SIDE_PANEL_HORIZONTAL_PADDING = 24;
export const TWO_PANEL_MAX_WIDTH = DATA_ENTRY_WIDTH + SIDE_PANEL_WIDTH * 2; // data entry panel (644) + side panels (360 * 2) (each side panel includes 24px left and right padding)
export const ONE_PANEL_MAX_WIDTH =
DATA_ENTRY_WIDTH + SIDE_PANEL_WIDTH + SIDE_PANEL_HORIZONTAL_PADDING; // data entry panel (644) + left side panel (360) + right padding from the right side panel (24)
export const SINGLE_COLUMN_MAX_WIDTH =
DATA_ENTRY_WIDTH + SIDE_PANEL_HORIZONTAL_PADDING * 2; // data entry panel (644) + left and right padding (24 * 2)
export const BREAKPOINT_HEIGHT = 750;
export const ReportDataEntryWrapper = styled.div`
z-index: 4;
background-color: ${palette.solid.white};
display: flex;
flex-direction: column;
align-items: center;
margin-top: -${HEADER_BAR_HEIGHT}px;
padding-top: ${HEADER_BAR_HEIGHT}px;
width: 100%;
`;
export const ReviewWrapper = styled(ReportDataEntryWrapper)`
display: block;
align-items: start;
@media only screen and (max-width: ${MIN_DESKTOP_WIDTH}px) {
display: flex;
align-items: center;
}
`;
export const PublishDataWrapper = styled.div`
width: ${SIDE_PANEL_WIDTH}px;
position: fixed;
top: 0;
right: 0;
z-index: 1;
padding: ${HEADER_BAR_HEIGHT + 31}px ${SIDE_PANEL_HORIZONTAL_PADDING}px 0
${SIDE_PANEL_HORIZONTAL_PADDING}px;
height: 100%;
@media only screen and (max-width: ${TWO_PANEL_MAX_WIDTH}px) {
display: none;
}
`;
export const FieldDescriptionTitle = styled.div`
margin-bottom: 10px;
color: ${palette.solid.darkgrey};
`;
export const FieldDescriptionContainer = styled.div`
${typography.sizeCSS.normal}
padding-top: 16px;
color: ${palette.highlight.grey9};
`;
export type FieldDescriptionProps = { title: string; description: string };
export const FieldDescription: React.FC<{
fieldDescription: FieldDescriptionProps;
}> = ({ fieldDescription }) => (
<FieldDescriptionContainer>
<FieldDescriptionTitle>{fieldDescription.title}</FieldDescriptionTitle>
{fieldDescription.description}
</FieldDescriptionContainer>
);