aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system/src/helpers/constants.ts
blob: 8c332f82c73388a001a54969e7b83c8fe182ae4e (plain)
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
/*
 * SonarQube
 * Copyright (C) 2009-2023 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

import { theme } from 'twin.macro';

export const DEFAULT_LOCALE = 'en';
export const IS_SSR = typeof window === 'undefined';
export const REACT_DOM_CONTAINER = '#content';

export const RULE_STATUSES = ['READY', 'BETA', 'DEPRECATED'];

export const THROTTLE_SCROLL_DELAY = 10;
export const THROTTLE_KEYPRESS_DELAY = 100;

export const DEBOUNCE_DELAY = 250;

export const DEBOUNCE_LONG_DELAY = 1000;

export const DEBOUNCE_SUCCESS_DELAY = 1000;

export const INTERACTIVE_TOOLTIP_DELAY = 0.5;

export const LEAK_PERIOD = 'sonar.leak.period';

export const LEAK_PERIOD_TYPE = 'sonar.leak.period.type';

export const INPUT_SIZES = {
  small: theme('width.input-small'),
  medium: theme('width.input-medium'),
  large: theme('width.input-large'),
  full: theme('width.full'),
  auto: theme('width.auto'),
};

export const LAYOUT_VIEWPORT_MIN_WIDTH = 1280;
export const LAYOUT_VIEWPORT_MAX_WIDTH = 1280;
export const LAYOUT_VIEWPORT_MAX_WIDTH_LARGE = 1680;
export const LAYOUT_MAIN_CONTENT_GUTTER = 60;
export const LAYOUT_SIDEBAR_WIDTH = 240;
export const LAYOUT_SIDEBAR_COLLAPSED_WIDTH = 60;
export const LAYOUT_SIDEBAR_BREAKPOINT = 1320;
export const LAYOUT_BANNER_HEIGHT = 44;
export const LAYOUT_BRANDING_ICON_WIDTH = 198;
export const LAYOUT_FILTERBAR_HEADER = 56;
export const LAYOUT_GLOBAL_NAV_HEIGHT = 52;
export const LAYOUT_PROJECT_NAV_HEIGHT = 108;
export const LAYOUT_LOGO_MARGIN_RIGHT = 45;
export const LAYOUT_LOGO_MAX_HEIGHT = 40;
export const LAYOUT_LOGO_MAX_WIDTH = 150;
export const LAYOUT_FOOTER_HEIGHT = 60;
export const LAYOUT_NOTIFICATIONSBAR_WIDTH = 350;

export const CORE_CONCEPTS_WIDTH = 350;

export const DARK_THEME_ID = 'dark-theme';

export const OPACITY_20_PERCENT = 0.2;

export const OPACITY_75_PERCENT = 0.75;

export const GLOBAL_POPUP_Z_INDEX = 5000;

export const TOAST_AUTOCLOSE_DELAY = 5000;