@centreon/ui 23.10.24 → 23.10.25-feature-MON-19319.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -1
- package/src/Dashboard/DashboardLayout.stories.tsx +3 -5
- package/src/Dashboard/Layout.tsx +4 -4
- package/src/Dashboard/utils.ts +28 -28
- package/src/ThemeProvider/index.tsx +6 -5
- package/src/ThemeProvider/palettes.ts +234 -208
- package/src/components/Button/Button.styles.ts +7 -2
- package/src/components/Header/Header.styles.ts +0 -27
- package/src/components/Header/PageHeader/PageHeader.stories.tsx +83 -0
- package/src/components/Header/PageHeader/PageHeader.styles.ts +105 -0
- package/src/components/Header/PageHeader/PageHeader.tsx +15 -0
- package/src/components/Header/PageHeader/PageHeaderActions.tsx +17 -0
- package/src/components/Header/PageHeader/PageHeaderMain.tsx +15 -0
- package/src/components/Header/PageHeader/PageHeaderMenu.tsx +15 -0
- package/src/components/Header/PageHeader/PageHeaderTitle.tsx +44 -0
- package/src/components/Header/PageHeader/index.ts +12 -0
- package/src/components/Header/index.ts +1 -1
- package/src/components/Layout/AreaIndicator.styles.ts +33 -0
- package/src/components/Layout/AreaIndicator.tsx +35 -0
- package/src/components/Layout/PageLayout/PageLayout.stories.tsx +81 -0
- package/src/components/Layout/PageLayout/PageLayout.styles.ts +30 -0
- package/src/components/Layout/PageLayout/PageLayout.tsx +21 -0
- package/src/components/Layout/PageLayout/PageLayoutActions.tsx +15 -0
- package/src/components/Layout/PageLayout/PageLayoutBody.tsx +24 -0
- package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +15 -0
- package/src/components/Layout/PageLayout/index.ts +10 -0
- package/src/components/Layout/index.ts +1 -0
- package/src/components/Menu/Menu.tsx +0 -0
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.stories.tsx +71 -0
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.styles.ts +5 -0
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +115 -0
- package/src/components/Tooltip/TextOverflowTooltip/index.tsx +1 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +41 -0
- package/src/components/Tooltip/Tooltip.styles.ts +5 -0
- package/src/components/Tooltip/Tooltip.tsx +46 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +0 -2
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +109 -101
- package/src/utils/useResizeObserver.ts +6 -0
- package/test/setupTests.js +23 -20
- package/src/components/Header/Header.stories.tsx +0 -27
- package/src/components/Header/Header.tsx +0 -23
- package/src/layout/TiledListingPage/TiledListingActions.tsx +0 -15
- package/src/layout/TiledListingPage/TiledListingContent.tsx +0 -21
- package/src/layout/TiledListingPage/TiledListingList.tsx +0 -11
- package/src/layout/TiledListingPage/TiledListingPage.styles.ts +0 -16
- package/src/layout/TiledListingPage/TiledListingPage.tsx +0 -15
- package/src/layout/TiledListingPage/index.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@centreon/ui",
|
|
3
|
-
"version": "23.10.
|
|
3
|
+
"version": "23.10.25-feature-MON-19319.0",
|
|
4
4
|
"description": "Centreon UI Components",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"storybook": "storybook dev -p 9001 -c .storybook",
|
|
9
9
|
"build:storybook": "storybook build -c .storybook -o .out",
|
|
10
10
|
"test": "jest",
|
|
11
|
+
"test:storybook:local": "test-storybook --url http://127.0.0.1:9001",
|
|
11
12
|
"test:ci": "jest --silent --reporter=jest-junit",
|
|
12
13
|
"cypress:ui": "cypress open --component --browser=chrome",
|
|
13
14
|
"cypress:cli:updateSnapshot": "pnpm cypress:cli --env updateSnapshots=true",
|
|
@@ -54,18 +55,23 @@
|
|
|
54
55
|
"@storybook/addon-interactions": "^7.0.9",
|
|
55
56
|
"@storybook/addon-styling": "^1.0.6",
|
|
56
57
|
"@storybook/builder-vite": "^7.0.9",
|
|
58
|
+
"@storybook/jest": "^0.1.0",
|
|
57
59
|
"@storybook/manager-api": "^7.0.9",
|
|
58
60
|
"@storybook/mdx2-csf": "^1.0.0",
|
|
59
61
|
"@storybook/preview-api": "^7.0.9",
|
|
60
62
|
"@storybook/react": "^7.0.9",
|
|
61
63
|
"@storybook/react-vite": "^7.0.9",
|
|
64
|
+
"@storybook/test-runner": "^0.10.0",
|
|
65
|
+
"@storybook/testing-library": "^0.1.0",
|
|
62
66
|
"@storybook/theming": "^7.0.9",
|
|
63
67
|
"@testing-library/cypress": "^8.0.7",
|
|
68
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
64
69
|
"@testing-library/react": "^13.4.0",
|
|
65
70
|
"@testing-library/react-hooks": "^8.0.1",
|
|
66
71
|
"@types/jest": "^27.5.0",
|
|
67
72
|
"@types/ramda": "^0.28.12",
|
|
68
73
|
"@types/react": "^18.0.26",
|
|
74
|
+
"@types/testing-library__jest-dom": "^5.14.6",
|
|
69
75
|
"@vitejs/plugin-react": "^4.0.0",
|
|
70
76
|
"@vitejs/plugin-react-swc": "^3.3.0",
|
|
71
77
|
"axios-mock-adapter": "^1.21.4",
|
|
@@ -83,6 +89,7 @@
|
|
|
83
89
|
"storybook": "^7.0.9",
|
|
84
90
|
"storybook-addon-mock": "^4.0.0",
|
|
85
91
|
"storybook-dark-mode": "^3.0.0",
|
|
92
|
+
"use-resize-observer": "^9.1.0",
|
|
86
93
|
"vite": "^4.3.5",
|
|
87
94
|
"vite-plugin-svgr": "^3.2.0",
|
|
88
95
|
"vite-plugin-turbosnap": "^1.0.2"
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
|
|
3
1
|
import { ComponentMeta } from '@storybook/react';
|
|
4
2
|
import { Layout } from 'react-grid-layout';
|
|
5
3
|
|
|
@@ -62,18 +60,18 @@ const generateLayout = (maxElements: number): Array<CustomLayout> => {
|
|
|
62
60
|
};
|
|
63
61
|
|
|
64
62
|
interface DashboardTemplateProps {
|
|
65
|
-
header?:
|
|
63
|
+
header?: JSX.Element;
|
|
66
64
|
layout?: Array<CustomLayout>;
|
|
67
65
|
}
|
|
68
66
|
|
|
69
|
-
const Header = ():
|
|
67
|
+
const Header = (): JSX.Element => (
|
|
70
68
|
<Typography variant="body2">The title</Typography>
|
|
71
69
|
);
|
|
72
70
|
|
|
73
71
|
const DashboardTemplate = ({
|
|
74
72
|
header,
|
|
75
73
|
layout = dashboardLayout
|
|
76
|
-
}: DashboardTemplateProps):
|
|
74
|
+
}: DashboardTemplateProps): JSX.Element => (
|
|
77
75
|
<DashboardLayout.Layout<CustomLayout> layout={layout}>
|
|
78
76
|
{layout.map(({ i, content, shouldUseFluidTypography }) => (
|
|
79
77
|
<DashboardLayout.Item header={header} key={i}>
|
package/src/Dashboard/Layout.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { Responsive } from '@visx/visx';
|
|
4
4
|
import GridLayout, { Layout, WidthProvider } from 'react-grid-layout';
|
|
@@ -14,7 +14,7 @@ const ReactGridLayout = WidthProvider(GridLayout);
|
|
|
14
14
|
|
|
15
15
|
interface DashboardLayoutProps<T> {
|
|
16
16
|
changeLayout?: (newLayout: Array<Layout>) => void;
|
|
17
|
-
children: Array<
|
|
17
|
+
children: Array<JSX.Element>;
|
|
18
18
|
displayGrid?: boolean;
|
|
19
19
|
layout: Array<T>;
|
|
20
20
|
}
|
|
@@ -24,7 +24,7 @@ const Layout = <T extends Layout>({
|
|
|
24
24
|
changeLayout,
|
|
25
25
|
displayGrid,
|
|
26
26
|
layout
|
|
27
|
-
}: DashboardLayoutProps<T>):
|
|
27
|
+
}: DashboardLayoutProps<T>): JSX.Element => {
|
|
28
28
|
const { classes } = useDashboardLayoutStyles();
|
|
29
29
|
|
|
30
30
|
const [columns, setColumns] = useState(getColumnsFromScreenSize());
|
|
@@ -45,7 +45,7 @@ const Layout = <T extends Layout>({
|
|
|
45
45
|
Component: (
|
|
46
46
|
<ResponsiveHeight>
|
|
47
47
|
<Responsive.ParentSize>
|
|
48
|
-
{({ width, height }):
|
|
48
|
+
{({ width, height }): JSX.Element => (
|
|
49
49
|
<div className={classes.container}>
|
|
50
50
|
{displayGrid && (
|
|
51
51
|
<Grid columns={columns} height={height} width={width} />
|
package/src/Dashboard/utils.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { lt } from 'ramda';
|
|
2
|
-
import { Layout } from 'react-grid-layout';
|
|
3
|
-
|
|
4
|
-
export const maxColumns = 12;
|
|
5
|
-
const minColumns = 1;
|
|
6
|
-
const breakpoint = 768;
|
|
7
|
-
|
|
8
|
-
export const rowHeight = 64;
|
|
9
|
-
|
|
10
|
-
export const getIsSmallScreenSize = (): boolean =>
|
|
11
|
-
lt(window.innerWidth, breakpoint);
|
|
12
|
-
|
|
13
|
-
export const getColumnsFromScreenSize = (): number =>
|
|
14
|
-
getIsSmallScreenSize() ? minColumns : maxColumns;
|
|
15
|
-
|
|
16
|
-
export const getLayout = <T extends Layout>(layout: Array<T>): Array<T> => {
|
|
17
|
-
const isSmallScreenSize = getIsSmallScreenSize();
|
|
18
|
-
if (!isSmallScreenSize) {
|
|
19
|
-
return layout;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return layout
|
|
23
|
-
.sort((a, b) => a.x + a.y - (b.x + b.y))
|
|
24
|
-
.map((widget) => ({
|
|
25
|
-
...widget,
|
|
26
|
-
w: 1
|
|
27
|
-
}));
|
|
28
|
-
};
|
|
1
|
+
import { lt } from 'ramda';
|
|
2
|
+
import { Layout } from 'react-grid-layout';
|
|
3
|
+
|
|
4
|
+
export const maxColumns = 12;
|
|
5
|
+
const minColumns = 1;
|
|
6
|
+
const breakpoint = 768;
|
|
7
|
+
|
|
8
|
+
export const rowHeight = 64;
|
|
9
|
+
|
|
10
|
+
export const getIsSmallScreenSize = (): boolean =>
|
|
11
|
+
lt(window.innerWidth, breakpoint);
|
|
12
|
+
|
|
13
|
+
export const getColumnsFromScreenSize = (): number =>
|
|
14
|
+
getIsSmallScreenSize() ? minColumns : maxColumns;
|
|
15
|
+
|
|
16
|
+
export const getLayout = <T extends Layout>(layout: Array<T>): Array<T> => {
|
|
17
|
+
const isSmallScreenSize = getIsSmallScreenSize();
|
|
18
|
+
if (!isSmallScreenSize) {
|
|
19
|
+
return layout;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return layout
|
|
23
|
+
.sort((a, b) => a.x + a.y - (b.x + b.y))
|
|
24
|
+
.map((widget) => ({
|
|
25
|
+
...widget,
|
|
26
|
+
w: 1
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
@@ -5,12 +5,12 @@ import { CSSInterpolation } from 'tss-react';
|
|
|
5
5
|
import { equals } from 'ramda';
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
Theme,
|
|
10
|
-
StyledEngineProvider,
|
|
8
|
+
ButtonProps,
|
|
11
9
|
createTheme,
|
|
12
10
|
InputBaseProps,
|
|
13
|
-
|
|
11
|
+
StyledEngineProvider,
|
|
12
|
+
Theme,
|
|
13
|
+
ThemeProvider as MuiThemeProvider
|
|
14
14
|
} from '@mui/material';
|
|
15
15
|
import CssBaseline from '@mui/material/CssBaseline';
|
|
16
16
|
import { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
@@ -177,6 +177,7 @@ export const getTheme = (mode: ThemeMode): ThemeOptions => ({
|
|
|
177
177
|
padding: 0;
|
|
178
178
|
width: 100%;
|
|
179
179
|
height: 100%;
|
|
180
|
+
text-rendering: optimizeLegibility;
|
|
180
181
|
}
|
|
181
182
|
body {
|
|
182
183
|
background-color: ${theme.palette.background.paper};
|
|
@@ -205,7 +206,7 @@ export const getTheme = (mode: ThemeMode): ThemeOptions => ({
|
|
|
205
206
|
@font-face {
|
|
206
207
|
font-family: 'Roboto';
|
|
207
208
|
font-style: normal;
|
|
208
|
-
font-weight:
|
|
209
|
+
font-weight: 700;
|
|
209
210
|
src: local('Roboto'), local('Roboto-Bold'), url(${RobotoBoldWoff2}) format('woff2');
|
|
210
211
|
}
|
|
211
212
|
`
|
|
@@ -1,208 +1,234 @@
|
|
|
1
|
-
import { equals } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import { alpha, PaletteOptions } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
import { ThemeMode } from '@centreon/ui-context';
|
|
6
|
-
|
|
7
|
-
declare module '@mui/material/styles/createPalette' {
|
|
8
|
-
interface TypeAction {
|
|
9
|
-
acknowledged: string;
|
|
10
|
-
acknowledgedBackground: string;
|
|
11
|
-
inDowntime: string;
|
|
12
|
-
inDowntimeBackground: string;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare module '@mui/material/styles' {
|
|
17
|
-
interface Palette {
|
|
18
|
-
background: {
|
|
19
|
-
default: string;
|
|
20
|
-
listingHeader: string;
|
|
21
|
-
panelGroups: string;
|
|
22
|
-
paper: string;
|
|
23
|
-
};
|
|
24
|
-
pending: {
|
|
25
|
-
contrastText: string;
|
|
26
|
-
main: string;
|
|
27
|
-
};
|
|
28
|
-
statusBackground: StatusBackground;
|
|
29
|
-
}
|
|
30
|
-
interface StatusBackground {
|
|
31
|
-
error: string;
|
|
32
|
-
none: string;
|
|
33
|
-
pending: string;
|
|
34
|
-
success: string;
|
|
35
|
-
unknown: string;
|
|
36
|
-
warning: string;
|
|
37
|
-
}
|
|
38
|
-
interface PaletteOptions {
|
|
39
|
-
pending: {
|
|
40
|
-
contrastText: string;
|
|
41
|
-
main: string;
|
|
42
|
-
};
|
|
43
|
-
statusBackground: StatusBackground;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
interface TypeBackground {
|
|
47
|
-
listingHeader: string;
|
|
48
|
-
panel: string;
|
|
49
|
-
panelGroups: string;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
declare module '@mui/material/Button' {
|
|
54
|
-
interface ButtonPropsColorOverrides {
|
|
55
|
-
pending: true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
declare module '@mui/material/Badge' {
|
|
60
|
-
interface BadgePropsColorOverrides {
|
|
61
|
-
pending: true;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export const lightPalette: PaletteOptions = {
|
|
66
|
-
action: {
|
|
67
|
-
acknowledged: '#67532C',
|
|
68
|
-
acknowledgedBackground: '#F5F1E9',
|
|
69
|
-
activatedOpacity: 0.12,
|
|
70
|
-
active: '#666666',
|
|
71
|
-
disabled: '#999999',
|
|
72
|
-
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
|
73
|
-
focus: 'rgba(0, 0, 0, 0.12)',
|
|
74
|
-
focusOpacity: 0.12,
|
|
75
|
-
hover: 'rgba(0, 0, 0, 0.06)',
|
|
76
|
-
hoverOpacity: 0.06,
|
|
77
|
-
inDowntime: '#4B2352',
|
|
78
|
-
inDowntimeBackground: '#F0E9F8',
|
|
79
|
-
selected: 'rgba(102, 102, 102, 0.3)',
|
|
80
|
-
selectedOpacity: 0.3
|
|
81
|
-
},
|
|
82
|
-
background: {
|
|
83
|
-
default: '#F4F4F4',
|
|
84
|
-
listingHeader: '#666666',
|
|
85
|
-
panel: '#EDEDED',
|
|
86
|
-
panelGroups: '#F5F5F5',
|
|
87
|
-
paper: '#FFFFFF'
|
|
88
|
-
},
|
|
89
|
-
divider: '#E3E3E3',
|
|
90
|
-
error: {
|
|
91
|
-
contrastText: '#000',
|
|
92
|
-
main: '#FF4A4A'
|
|
93
|
-
},
|
|
94
|
-
info: {
|
|
95
|
-
contrastText: '#000',
|
|
96
|
-
main: '#1588D1'
|
|
97
|
-
},
|
|
98
|
-
mode: ThemeMode.light,
|
|
99
|
-
pending: {
|
|
100
|
-
contrastText: '#000',
|
|
101
|
-
main: '#1EBEB3'
|
|
102
|
-
},
|
|
103
|
-
primary: {
|
|
104
|
-
contrastText: '#fff',
|
|
105
|
-
dark: '#255891',
|
|
106
|
-
light: '#cde7fc',
|
|
107
|
-
main: '#2E68AA'
|
|
108
|
-
},
|
|
109
|
-
secondary: {
|
|
110
|
-
contrastText: '#fff',
|
|
111
|
-
main: '#C772D6'
|
|
112
|
-
},
|
|
113
|
-
statusBackground: {
|
|
114
|
-
error: '#FF6666',
|
|
115
|
-
none: alpha('#2E68AA', 0.1),
|
|
116
|
-
pending: '#1EBEB3',
|
|
117
|
-
success: '#88B922',
|
|
118
|
-
unknown: '#E3E3E3',
|
|
119
|
-
warning: '#FD9B27'
|
|
120
|
-
},
|
|
121
|
-
success: {
|
|
122
|
-
contrastText: '#000',
|
|
123
|
-
main: '#88B922'
|
|
124
|
-
},
|
|
125
|
-
text: {
|
|
126
|
-
disabled: '#999999',
|
|
127
|
-
primary: '#000000',
|
|
128
|
-
secondary: '#666666'
|
|
129
|
-
},
|
|
130
|
-
warning: {
|
|
131
|
-
contrastText: '#000',
|
|
132
|
-
main: '#FD9B27'
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export const darkPalette: PaletteOptions = {
|
|
137
|
-
action: {
|
|
138
|
-
acknowledged: '#67532C',
|
|
139
|
-
acknowledgedBackground: '#67532C',
|
|
140
|
-
activatedOpacity: 0.3,
|
|
141
|
-
active: '#B5B5B5',
|
|
142
|
-
disabled: '#999999',
|
|
143
|
-
disabledBackground: '#555555',
|
|
144
|
-
focus: 'rgba(255, 255, 255, 0.30)',
|
|
145
|
-
focusOpacity: 0.3,
|
|
146
|
-
hover: 'rgba(255, 255, 255, 0.16)',
|
|
147
|
-
hoverOpacity: 0.16,
|
|
148
|
-
inDowntime: '#4B2352',
|
|
149
|
-
inDowntimeBackground: '#4B2352',
|
|
150
|
-
selected: 'rgba(255, 255, 255, 0.5)',
|
|
151
|
-
selectedOpacity: 0.5
|
|
152
|
-
},
|
|
153
|
-
background: {
|
|
154
|
-
default: '#4a4a4a',
|
|
155
|
-
listingHeader: '#666666',
|
|
156
|
-
panel: '#4a4a4a',
|
|
157
|
-
panelGroups: '#252525',
|
|
158
|
-
paper: '#212121'
|
|
159
|
-
},
|
|
160
|
-
divider: '#666666',
|
|
161
|
-
error: {
|
|
162
|
-
contrastText: '#fff',
|
|
163
|
-
main: '#D60101'
|
|
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
|
-
|
|
1
|
+
import { equals } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { alpha, PaletteOptions } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
import { ThemeMode } from '@centreon/ui-context';
|
|
6
|
+
|
|
7
|
+
declare module '@mui/material/styles/createPalette' {
|
|
8
|
+
interface TypeAction {
|
|
9
|
+
acknowledged: string;
|
|
10
|
+
acknowledgedBackground: string;
|
|
11
|
+
inDowntime: string;
|
|
12
|
+
inDowntimeBackground: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '@mui/material/styles' {
|
|
17
|
+
interface Palette {
|
|
18
|
+
background: {
|
|
19
|
+
default: string;
|
|
20
|
+
listingHeader: string;
|
|
21
|
+
panelGroups: string;
|
|
22
|
+
paper: string;
|
|
23
|
+
};
|
|
24
|
+
pending: {
|
|
25
|
+
contrastText: string;
|
|
26
|
+
main: string;
|
|
27
|
+
};
|
|
28
|
+
statusBackground: StatusBackground;
|
|
29
|
+
}
|
|
30
|
+
interface StatusBackground {
|
|
31
|
+
error: string;
|
|
32
|
+
none: string;
|
|
33
|
+
pending: string;
|
|
34
|
+
success: string;
|
|
35
|
+
unknown: string;
|
|
36
|
+
warning: string;
|
|
37
|
+
}
|
|
38
|
+
interface PaletteOptions {
|
|
39
|
+
pending: {
|
|
40
|
+
contrastText: string;
|
|
41
|
+
main: string;
|
|
42
|
+
};
|
|
43
|
+
statusBackground: StatusBackground;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface TypeBackground {
|
|
47
|
+
listingHeader: string;
|
|
48
|
+
panel: string;
|
|
49
|
+
panelGroups: string;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare module '@mui/material/Button' {
|
|
54
|
+
interface ButtonPropsColorOverrides {
|
|
55
|
+
pending: true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare module '@mui/material/Badge' {
|
|
60
|
+
interface BadgePropsColorOverrides {
|
|
61
|
+
pending: true;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const lightPalette: PaletteOptions = {
|
|
66
|
+
action: {
|
|
67
|
+
acknowledged: '#67532C',
|
|
68
|
+
acknowledgedBackground: '#F5F1E9',
|
|
69
|
+
activatedOpacity: 0.12,
|
|
70
|
+
active: '#666666',
|
|
71
|
+
disabled: '#999999',
|
|
72
|
+
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
|
73
|
+
focus: 'rgba(0, 0, 0, 0.12)',
|
|
74
|
+
focusOpacity: 0.12,
|
|
75
|
+
hover: 'rgba(0, 0, 0, 0.06)',
|
|
76
|
+
hoverOpacity: 0.06,
|
|
77
|
+
inDowntime: '#4B2352',
|
|
78
|
+
inDowntimeBackground: '#F0E9F8',
|
|
79
|
+
selected: 'rgba(102, 102, 102, 0.3)',
|
|
80
|
+
selectedOpacity: 0.3
|
|
81
|
+
},
|
|
82
|
+
background: {
|
|
83
|
+
default: '#F4F4F4',
|
|
84
|
+
listingHeader: '#666666',
|
|
85
|
+
panel: '#EDEDED',
|
|
86
|
+
panelGroups: '#F5F5F5',
|
|
87
|
+
paper: '#FFFFFF'
|
|
88
|
+
},
|
|
89
|
+
divider: '#E3E3E3',
|
|
90
|
+
error: {
|
|
91
|
+
contrastText: '#000',
|
|
92
|
+
main: '#FF4A4A'
|
|
93
|
+
},
|
|
94
|
+
info: {
|
|
95
|
+
contrastText: '#000',
|
|
96
|
+
main: '#1588D1'
|
|
97
|
+
},
|
|
98
|
+
mode: ThemeMode.light,
|
|
99
|
+
pending: {
|
|
100
|
+
contrastText: '#000',
|
|
101
|
+
main: '#1EBEB3'
|
|
102
|
+
},
|
|
103
|
+
primary: {
|
|
104
|
+
contrastText: '#fff',
|
|
105
|
+
dark: '#255891',
|
|
106
|
+
light: '#cde7fc',
|
|
107
|
+
main: '#2E68AA'
|
|
108
|
+
},
|
|
109
|
+
secondary: {
|
|
110
|
+
contrastText: '#fff',
|
|
111
|
+
main: '#C772D6'
|
|
112
|
+
},
|
|
113
|
+
statusBackground: {
|
|
114
|
+
error: '#FF6666',
|
|
115
|
+
none: alpha('#2E68AA', 0.1),
|
|
116
|
+
pending: '#1EBEB3',
|
|
117
|
+
success: '#88B922',
|
|
118
|
+
unknown: '#E3E3E3',
|
|
119
|
+
warning: '#FD9B27'
|
|
120
|
+
},
|
|
121
|
+
success: {
|
|
122
|
+
contrastText: '#000',
|
|
123
|
+
main: '#88B922'
|
|
124
|
+
},
|
|
125
|
+
text: {
|
|
126
|
+
disabled: '#999999',
|
|
127
|
+
primary: '#000000',
|
|
128
|
+
secondary: '#666666'
|
|
129
|
+
},
|
|
130
|
+
warning: {
|
|
131
|
+
contrastText: '#000',
|
|
132
|
+
main: '#FD9B27'
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const darkPalette: PaletteOptions = {
|
|
137
|
+
action: {
|
|
138
|
+
acknowledged: '#67532C',
|
|
139
|
+
acknowledgedBackground: '#67532C',
|
|
140
|
+
activatedOpacity: 0.3,
|
|
141
|
+
active: '#B5B5B5',
|
|
142
|
+
disabled: '#999999',
|
|
143
|
+
disabledBackground: '#555555',
|
|
144
|
+
focus: 'rgba(255, 255, 255, 0.30)',
|
|
145
|
+
focusOpacity: 0.3,
|
|
146
|
+
hover: 'rgba(255, 255, 255, 0.16)',
|
|
147
|
+
hoverOpacity: 0.16,
|
|
148
|
+
inDowntime: '#4B2352',
|
|
149
|
+
inDowntimeBackground: '#4B2352',
|
|
150
|
+
selected: 'rgba(255, 255, 255, 0.5)',
|
|
151
|
+
selectedOpacity: 0.5
|
|
152
|
+
},
|
|
153
|
+
background: {
|
|
154
|
+
default: '#4a4a4a',
|
|
155
|
+
listingHeader: '#666666',
|
|
156
|
+
panel: '#4a4a4a',
|
|
157
|
+
panelGroups: '#252525',
|
|
158
|
+
paper: '#212121'
|
|
159
|
+
},
|
|
160
|
+
divider: '#666666',
|
|
161
|
+
error: {
|
|
162
|
+
contrastText: '#fff',
|
|
163
|
+
main: '#D60101'
|
|
164
|
+
},
|
|
165
|
+
header: {
|
|
166
|
+
page: {
|
|
167
|
+
action: {
|
|
168
|
+
background: {
|
|
169
|
+
active: '#1975D10F',
|
|
170
|
+
default: '#FFFFFF00'
|
|
171
|
+
},
|
|
172
|
+
color: {
|
|
173
|
+
active: '#1976D2',
|
|
174
|
+
default: '#696969'
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
border: '#bdbdbd',
|
|
178
|
+
description: '#bdbdbd',
|
|
179
|
+
title: '#fff'
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
info: {
|
|
183
|
+
contrastText: '#fff',
|
|
184
|
+
main: '#1CA9F4'
|
|
185
|
+
},
|
|
186
|
+
layout: {
|
|
187
|
+
body: {
|
|
188
|
+
background: '#F6F6F6'
|
|
189
|
+
},
|
|
190
|
+
header: {
|
|
191
|
+
background: '#FFFFFF',
|
|
192
|
+
border: '#E3E3E3'
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
mode: ThemeMode.dark,
|
|
196
|
+
pending: {
|
|
197
|
+
contrastText: '#fff',
|
|
198
|
+
main: '#118077'
|
|
199
|
+
},
|
|
200
|
+
primary: {
|
|
201
|
+
contrastText: '#000',
|
|
202
|
+
dark: '#4974A5',
|
|
203
|
+
light: '#8bbff9',
|
|
204
|
+
main: '#6eaff8'
|
|
205
|
+
},
|
|
206
|
+
secondary: {
|
|
207
|
+
contrastText: '#fff',
|
|
208
|
+
main: '#7C1FA2'
|
|
209
|
+
},
|
|
210
|
+
statusBackground: {
|
|
211
|
+
error: '#D60101',
|
|
212
|
+
none: alpha('#2E68AA', 0.1),
|
|
213
|
+
pending: '#118077',
|
|
214
|
+
success: '#5F8118',
|
|
215
|
+
unknown: '#666666',
|
|
216
|
+
warning: '#C55400'
|
|
217
|
+
},
|
|
218
|
+
success: {
|
|
219
|
+
contrastText: '#fff',
|
|
220
|
+
main: '#5F8118'
|
|
221
|
+
},
|
|
222
|
+
text: {
|
|
223
|
+
disabled: '#666666',
|
|
224
|
+
primary: '#FFFFFF',
|
|
225
|
+
secondary: '#CCCCCC'
|
|
226
|
+
},
|
|
227
|
+
warning: {
|
|
228
|
+
contrastText: '#fff',
|
|
229
|
+
main: '#C55400'
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export const getPalette = (mode: ThemeMode): PaletteOptions =>
|
|
234
|
+
equals(mode, ThemeMode.dark) ? darkPalette : lightPalette;
|
|
@@ -3,8 +3,13 @@ import { makeStyles } from 'tss-react/mui';
|
|
|
3
3
|
const useStyles = makeStyles()((theme) => ({
|
|
4
4
|
button: {
|
|
5
5
|
'&[data-size="small"]': {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
'&[data-variant="primary"], &[data-variant="secondary"]': {
|
|
7
|
+
paddingLeft: theme.spacing(2),
|
|
8
|
+
paddingRight: theme.spacing(2)
|
|
9
|
+
},
|
|
10
|
+
fontSize: '14px',
|
|
11
|
+
height: 'unset',
|
|
12
|
+
lineHeight: '22px'
|
|
8
13
|
},
|
|
9
14
|
|
|
10
15
|
'&[data-variant="primary"]:not(:disabled)': {
|