-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathindex.tsx
223 lines (184 loc) · 5.88 KB
/
index.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { EuiBadge, EuiDescriptionList, EuiFlexGroup, EuiIcon } from '@elastic/eui';
import styled, { createGlobalStyle, css } from 'styled-components';
import { FULL_SCREEN_TOGGLED_CLASS_NAME } from '../../../../common/constants';
export const SecuritySolutionAppWrapper = styled.div`
display: flex;
flex-direction: column;
flex: 1 1 auto;
width: 100%;
`;
SecuritySolutionAppWrapper.displayName = 'SecuritySolutionAppWrapper';
/**
* Stylesheet for Eui class overrides for components that may be displayed when content
* on the page has been set to display in full screen mode. It ensures that certain Eui
* components, that position themselves just below the kibana header, are displayed correctly
* when shown above content that is set to `full screen`.
*/
export const FULL_SCREEN_CONTENT_OVERRIDES_CSS_STYLESHEET = () => css`
.euiOverlayMask[data-relative-to-header='below'] {
top: 0 !important;
}
.euiFlyout {
top: 0 !important;
height: 100% !important;
}
`;
/**
* Stylesheet with Eui class overrides in order to address display issues caused when
* the Timeline overlay is opened. These are normally adjustments to ensure that the
* z-index of other EUI components continues to work with the z-index used by timeline
* overlay.
*/
export const TIMELINE_OVERRIDES_CSS_STYLESHEET = () => css`
.euiPopover__panel[data-popover-open] {
z-index: 9900 !important;
min-width: 24px;
}
.euiPopover__panel[data-popover-open].sourcererPopoverPanel {
// needs to appear under modal
z-index: 5900 !important;
}
.euiToolTip {
z-index: 9950 !important;
}
/*
overrides the default styling of euiComboBoxOptionsList because it's implemented
as a popover, so it's not selectable as a child of the styled component
*/
.euiComboBoxOptionsList {
z-index: 9999;
}
/* ensure elastic charts tooltips appear above open euiPopovers */
.echTooltip {
z-index: 9950;
}
`;
/*
SIDE EFFECT: the following `createGlobalStyle` overrides default styling in angular code that was not theme-friendly
and `EuiPopover`, `EuiToolTip` global styles
*/
export const AppGlobalStyle = createGlobalStyle<{ theme: { eui: { euiColorPrimary: string } } }>`
${TIMELINE_OVERRIDES_CSS_STYLESHEET}
.euiDataGridRowCell .euiDataGridRowCell__expandActions .euiDataGridRowCell__actionButtonIcon {
display: none;
&:first-child,
&:nth-child(2),
&:nth-child(3),
&:last-child {
display: inline-flex;
}
}
/*
overrides the default styling of EuiDataGrid expand popover footer to
make it a column of actions instead of the default actions row
*/
.euiDataGridRowCell__popover {
max-width: 815px !important;
max-height: none !important;
overflow: hidden;
.expandable-top-value-button {
&.euiButtonEmpty--primary:enabled:focus,
.euiButtonEmpty--primary:focus {
background-color: transparent;
}
}
&.euiPopover__panel[data-popover-open] {
padding: 8px 0;
min-width: 65px;
}
.euiPopoverFooter {
border: 0;
margin-top: 0 !important;
.euiFlexGroup {
flex-direction: column;
}
}
// Hide EUI's 'Filter in' and 'Filter out' footer buttons - replaced with our own buttons
.euiPopoverFooter:nth-child(2) {
.euiFlexItem:first-child,
.euiFlexItem:nth-child(2) {
display: none;
}
}
}
/* overrides default styling in angular code that was not theme-friendly */
.euiPanel-loading-hide-border {
border: none;
}
/* hide open draggable popovers when a modal is being displayed to prevent them from covering the modal */
body.euiBody-hasOverlayMask {
.euiDataGridRowCell__popover[data-popover-open],
.withHoverActions__popover[data-popover-open] {
visibility: hidden !important;
}
}
/* applies a "toggled" button style to the Full Screen button */
.${FULL_SCREEN_TOGGLED_CLASS_NAME} {
${({ theme }) => `background-color: ${theme.eui.euiColorPrimary} !important`};
}
/*
EuiScreenReaderOnly has a default 1px height and width. These extra pixels
were adding additional height to every table row in the alerts table on the
Detections page. As a result of this extra height, the Detections page was
displaying unnecessary scroll bars and unnecessary empty space bellow the
alerts table. Thus, we set the height and width of all EuiScreenReaderOnly
to zero.
*/
.euiScreenReaderOnly {
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
`;
export const DescriptionListStyled = styled(EuiDescriptionList)`
${({ theme }) => `
word-break: break-word;
dt {
font-size: ${theme.eui.euiFontSizeXS} !important;
}
dd {
width: fit-content;
}
dd > div {
width: fit-content;
}
`}
`;
DescriptionListStyled.displayName = 'DescriptionListStyled';
export const CountBadge = styled(EuiBadge)`
margin-left: 5px;
` as unknown as typeof EuiBadge;
CountBadge.displayName = 'CountBadge';
export const Spacer = styled.span`
margin-left: 5px;
`;
Spacer.displayName = 'Spacer';
export const Badge = styled(EuiBadge)`
vertical-align: top;
` as unknown as typeof EuiBadge;
Badge.displayName = 'Badge';
export const MoreRowItems = styled(EuiIcon)`
margin-left: 5px;
`;
MoreRowItems.displayName = 'MoreRowItems';
export const OverviewWrapper = styled(EuiFlexGroup)`
position: relative;
.euiButtonIcon {
position: absolute;
right: ${(props) => props.theme.eui.euiSizeM};
top: 6px;
z-index: 2;
}
`;
OverviewWrapper.displayName = 'OverviewWrapper';