@centreon/ui 23.10.30-MON-19324-dashboard-section-navigation.3 → 23.10.30

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.
Files changed (205) hide show
  1. package/package.json +9 -12
  2. package/src/@assets/icons/downtime.icon.svg +1 -0
  3. package/src/Dashboard/DashboardLayout.stories.tsx +5 -3
  4. package/src/Dashboard/Layout.tsx +4 -4
  5. package/src/Dashboard/utils.ts +28 -28
  6. package/src/Graph/BasicComponents/Axes/UnitLabel.tsx +20 -0
  7. package/src/Graph/BasicComponents/Axes/index.tsx +88 -0
  8. package/src/Graph/BasicComponents/Axes/models.ts +26 -0
  9. package/src/Graph/BasicComponents/Axes/useAxisY.ts +100 -0
  10. package/src/Graph/BasicComponents/Grids/index.tsx +20 -0
  11. package/src/Graph/BasicComponents/Lines/RegularLines/index.tsx +91 -0
  12. package/src/Graph/BasicComponents/Lines/RegularLines/useRegularLines.ts +15 -0
  13. package/src/Graph/BasicComponents/Lines/StackedLines/index.tsx +76 -0
  14. package/src/Graph/BasicComponents/Lines/StackedLines/useStackedLines.ts +39 -0
  15. package/src/Graph/BasicComponents/Lines/Threshold/BasicThreshold.tsx +51 -0
  16. package/src/Graph/BasicComponents/Lines/Threshold/Circle.tsx +43 -0
  17. package/src/Graph/BasicComponents/Lines/Threshold/ThresholdWithPatternLines.tsx +73 -0
  18. package/src/Graph/BasicComponents/Lines/Threshold/ThresholdWithVariation.tsx +59 -0
  19. package/src/Graph/BasicComponents/Lines/Threshold/helpers/index.ts +69 -0
  20. package/src/Graph/BasicComponents/Lines/Threshold/index.tsx +138 -0
  21. package/src/Graph/BasicComponents/Lines/Threshold/models.ts +105 -0
  22. package/src/Graph/BasicComponents/Lines/Threshold/useCoordinateCircle.ts +46 -0
  23. package/src/Graph/BasicComponents/Lines/Threshold/useScaleThreshold.ts +171 -0
  24. package/src/Graph/BasicComponents/Lines/index.tsx +180 -0
  25. package/src/Graph/BasicComponents/Lines/models.ts +42 -0
  26. package/src/Graph/BasicComponents/LoadingProgress.tsx +46 -0
  27. package/src/Graph/BasicComponents/useFilterLines.ts +60 -0
  28. package/src/Graph/Graph.styles.ts +45 -0
  29. package/src/Graph/Graph.tsx +217 -0
  30. package/src/Graph/Header/index.tsx +65 -0
  31. package/src/Graph/Icons/Downtime.tsx +9 -0
  32. package/src/Graph/InteractiveComponents/AnchorPoint/AnchorPoint.styles.ts +58 -0
  33. package/src/Graph/InteractiveComponents/AnchorPoint/GuidingLines.tsx +45 -0
  34. package/src/Graph/InteractiveComponents/AnchorPoint/RegularAnchorPoint.tsx +66 -0
  35. package/src/Graph/InteractiveComponents/AnchorPoint/StackedAnchorPoint.tsx +76 -0
  36. package/src/Graph/InteractiveComponents/AnchorPoint/TooltipAnchorPoint.tsx +70 -0
  37. package/src/Graph/InteractiveComponents/AnchorPoint/index.tsx +20 -0
  38. package/src/Graph/InteractiveComponents/AnchorPoint/models.ts +62 -0
  39. package/src/Graph/InteractiveComponents/AnchorPoint/useTickGraph.ts +94 -0
  40. package/src/Graph/InteractiveComponents/AnchorPoint/useTooltipAnchorPoint.ts +107 -0
  41. package/src/Graph/InteractiveComponents/Annotations/Annotation/Area.tsx +114 -0
  42. package/src/Graph/InteractiveComponents/Annotations/Annotation/Line.tsx +103 -0
  43. package/src/Graph/InteractiveComponents/Annotations/Annotation/index.tsx +81 -0
  44. package/src/Graph/InteractiveComponents/Annotations/Area/Downtime.tsx +27 -0
  45. package/src/Graph/InteractiveComponents/Annotations/EventAnnotations.tsx +61 -0
  46. package/src/Graph/InteractiveComponents/Annotations/Line/Acknowledgement.tsx +27 -0
  47. package/src/Graph/InteractiveComponents/Annotations/Line/Comments.tsx +25 -0
  48. package/src/Graph/InteractiveComponents/Annotations/annotationsAtoms.ts +183 -0
  49. package/src/Graph/InteractiveComponents/Annotations/index.tsx +49 -0
  50. package/src/Graph/InteractiveComponents/Annotations/models.ts +25 -0
  51. package/src/Graph/InteractiveComponents/Annotations/useAnnotation.ts +56 -0
  52. package/src/Graph/InteractiveComponents/Bar.tsx +21 -0
  53. package/src/Graph/InteractiveComponents/TimeShiftZones/TimeShiftIcon.tsx +62 -0
  54. package/src/Graph/InteractiveComponents/TimeShiftZones/TimeShiftZone.tsx +74 -0
  55. package/src/Graph/InteractiveComponents/TimeShiftZones/index.tsx +85 -0
  56. package/src/Graph/InteractiveComponents/TimeShiftZones/models.ts +12 -0
  57. package/src/Graph/InteractiveComponents/TimeShiftZones/useTimeShiftZones.ts +72 -0
  58. package/src/Graph/InteractiveComponents/Tooltip/index.tsx +59 -0
  59. package/src/Graph/InteractiveComponents/Tooltip/models.ts +9 -0
  60. package/src/Graph/InteractiveComponents/Tooltip/useGraphTooltip.ts +67 -0
  61. package/src/Graph/InteractiveComponents/ZoomPreview/index.tsx +38 -0
  62. package/src/Graph/InteractiveComponents/ZoomPreview/models.ts +9 -0
  63. package/src/Graph/InteractiveComponents/ZoomPreview/useZoomPreview.ts +107 -0
  64. package/src/Graph/InteractiveComponents/ZoomPreview/zoomPreviewAtoms.ts +3 -0
  65. package/src/Graph/InteractiveComponents/index.tsx +168 -0
  66. package/src/Graph/InteractiveComponents/interactionWithGraphAtoms.ts +51 -0
  67. package/src/Graph/Legend/InteractiveValue.tsx +22 -0
  68. package/src/Graph/Legend/Legend.styles.ts +71 -0
  69. package/src/Graph/Legend/LegendContent.tsx +27 -0
  70. package/src/Graph/Legend/LegendHeader.tsx +45 -0
  71. package/src/Graph/Legend/Marker.tsx +43 -0
  72. package/src/Graph/Legend/index.tsx +166 -0
  73. package/src/Graph/Legend/models.ts +11 -0
  74. package/src/Graph/Legend/useInteractiveValues.ts +86 -0
  75. package/src/Graph/Legend/useLegend.ts +114 -0
  76. package/src/Graph/LoadingSkeleton.tsx +44 -0
  77. package/src/Graph/common/index.ts +35 -0
  78. package/src/Graph/graphAtoms.ts +6 -0
  79. package/src/Graph/helpers/doc.ts +560 -0
  80. package/src/Graph/helpers/index.ts +58 -0
  81. package/src/Graph/index.stories.tsx +372 -0
  82. package/src/Graph/index.tsx +90 -0
  83. package/src/Graph/mockedData/annotationData.json +326 -0
  84. package/src/Graph/mockedData/exclusionPeriodFirstPeriod.json +588 -0
  85. package/src/Graph/mockedData/exclusionPeriodSecondPeriod.json +588 -0
  86. package/src/Graph/mockedData/exclusionPeriodThirdPeriod.json +581 -0
  87. package/src/Graph/mockedData/lastDay.json +1326 -0
  88. package/src/Graph/mockedData/lastDayAreaStack.json +3106 -0
  89. package/src/Graph/mockedData/lastDayForward.json +1338 -0
  90. package/src/Graph/mockedData/lastDayThreshold.json +2352 -0
  91. package/src/Graph/mockedData/lastMonth.json +1674 -0
  92. package/src/Graph/mockedData/lastWeek.json +2202 -0
  93. package/src/Graph/mockedData/zoomPreview.json +742 -0
  94. package/src/Graph/models.ts +150 -0
  95. package/src/Graph/timeSeries/index.test.ts +506 -0
  96. package/src/Graph/timeSeries/index.ts +512 -0
  97. package/src/Graph/timeSeries/models.ts +120 -0
  98. package/src/Graph/translatedLabels.ts +9 -0
  99. package/src/Graph/useGraphData.ts +47 -0
  100. package/src/Graph/useGraphIntersection.ts +36 -0
  101. package/src/ThemeProvider/index.tsx +5 -6
  102. package/src/ThemeProvider/palettes.ts +215 -385
  103. package/src/TimePeriods/CustomTimePeriod/CompactCustomTimePeriod.styles.ts +51 -0
  104. package/src/TimePeriods/CustomTimePeriod/CompactCustomTimePeriod.tsx +95 -0
  105. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/ErrorText.tsx +14 -0
  106. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +163 -0
  107. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/index.tsx +76 -0
  108. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +61 -0
  109. package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/usePickersStartEndDate.ts +82 -0
  110. package/src/TimePeriods/CustomTimePeriod/index.tsx +66 -0
  111. package/src/TimePeriods/DateTimePickerInput.tsx +49 -0
  112. package/src/TimePeriods/ResolutionTimePeriod.cypress.spec.tsx +65 -0
  113. package/src/TimePeriods/SelectedTimePeriod.tsx +102 -0
  114. package/src/TimePeriods/TimePeriods.cypress.spec.tsx +510 -0
  115. package/src/TimePeriods/TimePeriods.styles.ts +22 -0
  116. package/src/TimePeriods/helpers/index.ts +26 -0
  117. package/src/TimePeriods/index.stories.tsx +98 -0
  118. package/src/TimePeriods/index.tsx +78 -0
  119. package/src/TimePeriods/mockedData.ts +12 -0
  120. package/src/TimePeriods/models.ts +97 -0
  121. package/src/TimePeriods/timePeriodsAtoms.ts +102 -0
  122. package/src/TimePeriods/translatedLabels.ts +9 -0
  123. package/src/TimePeriods/useSortTimePeriods.ts +31 -0
  124. package/src/TimePeriods/useTimePeriod.ts +49 -0
  125. package/src/api/TestQueryProvider.tsx +1 -2
  126. package/src/api/useFetchQuery/index.ts +7 -8
  127. package/src/api/useMutationQuery/index.ts +10 -11
  128. package/src/components/Button/Button.styles.ts +3 -17
  129. package/src/components/Button/Button.tsx +3 -6
  130. package/src/components/Button/Icon/IconButton.styles.ts +2 -9
  131. package/src/components/DataTable/DataTable.stories.tsx +0 -9
  132. package/src/components/DataTable/DataTable.styles.ts +0 -5
  133. package/src/components/DataTable/DataTable.tsx +6 -8
  134. package/src/components/DataTable/EmptyState/DataTableEmptyState.tsx +1 -4
  135. package/src/components/DataTable/Item/DataTableItem.styles.ts +2 -5
  136. package/src/components/DataTable/Item/DataTableItem.tsx +18 -36
  137. package/src/components/Header/Header.stories.tsx +27 -0
  138. package/src/components/Header/Header.styles.ts +27 -0
  139. package/src/components/Header/Header.tsx +23 -0
  140. package/src/components/Header/index.ts +1 -1
  141. package/src/components/Modal/index.ts +0 -2
  142. package/src/components/index.ts +0 -3
  143. package/src/index.ts +2 -0
  144. package/src/layout/TiledListingPage/TiledListingActions.tsx +15 -0
  145. package/src/layout/TiledListingPage/TiledListingContent.tsx +21 -0
  146. package/src/layout/TiledListingPage/TiledListingList.tsx +11 -0
  147. package/src/layout/TiledListingPage/TiledListingPage.styles.ts +16 -0
  148. package/src/layout/TiledListingPage/TiledListingPage.tsx +15 -0
  149. package/src/layout/TiledListingPage/index.ts +4 -0
  150. package/src/screens/dashboard/DashboardsOverview.stories.tsx +102 -110
  151. package/src/utils/index.ts +1 -1
  152. package/src/utils/sanitizedHTML.ts +1 -1
  153. package/test/setupTests.js +0 -3
  154. package/src/base/tokens/README.md +0 -3
  155. package/src/base/tokens/source/$metadata.json +0 -5
  156. package/src/base/tokens/source/base.json +0 -142
  157. package/src/base/tokens/themes/base.tokens.d.ts +0 -38
  158. package/src/base/tokens/themes/base.tokens.json +0 -695
  159. package/src/base/tokens/themes/base.tokens.ts +0 -38
  160. package/src/base/tokens/themes/ui-dark.tokens.d.ts +0 -38
  161. package/src/base/tokens/themes/ui-dark.tokens.json +0 -695
  162. package/src/base/tokens/themes/ui-dark.tokens.ts +0 -38
  163. package/src/base/tokens/themes/ui-light.tokens.d.ts +0 -38
  164. package/src/base/tokens/themes/ui-light.tokens.json +0 -695
  165. package/src/base/tokens/themes/ui-light.tokens.ts +0 -38
  166. package/src/components/Header/PageHeader/PageHeader.stories.tsx +0 -88
  167. package/src/components/Header/PageHeader/PageHeader.styles.ts +0 -99
  168. package/src/components/Header/PageHeader/PageHeader.tsx +0 -15
  169. package/src/components/Header/PageHeader/PageHeaderActions.tsx +0 -17
  170. package/src/components/Header/PageHeader/PageHeaderMain.tsx +0 -15
  171. package/src/components/Header/PageHeader/PageHeaderMenu.tsx +0 -15
  172. package/src/components/Header/PageHeader/PageHeaderTitle.tsx +0 -47
  173. package/src/components/Header/PageHeader/index.ts +0 -12
  174. package/src/components/Layout/AreaIndicator.styles.ts +0 -33
  175. package/src/components/Layout/AreaIndicator.tsx +0 -35
  176. package/src/components/Layout/PageLayout/PageLayout.stories.tsx +0 -81
  177. package/src/components/Layout/PageLayout/PageLayout.styles.ts +0 -40
  178. package/src/components/Layout/PageLayout/PageLayout.tsx +0 -21
  179. package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -15
  180. package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -24
  181. package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +0 -15
  182. package/src/components/Layout/PageLayout/index.ts +0 -10
  183. package/src/components/Layout/index.ts +0 -1
  184. package/src/components/Menu/Button/MenuButton.stories.tsx +0 -16
  185. package/src/components/Menu/Button/MenuButton.styles.ts +0 -27
  186. package/src/components/Menu/Button/MenuButton.tsx +0 -59
  187. package/src/components/Menu/Button/index.ts +0 -1
  188. package/src/components/Menu/Menu.stories.tsx +0 -71
  189. package/src/components/Menu/Menu.styles.ts +0 -70
  190. package/src/components/Menu/Menu.tsx +0 -25
  191. package/src/components/Menu/MenuDivider.tsx +0 -13
  192. package/src/components/Menu/MenuItem.tsx +0 -36
  193. package/src/components/Menu/MenuItems.tsx +0 -35
  194. package/src/components/Menu/index.ts +0 -12
  195. package/src/components/Menu/useMenu.tsx +0 -79
  196. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.stories.tsx +0 -71
  197. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.styles.ts +0 -5
  198. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +0 -115
  199. package/src/components/Tooltip/TextOverflowTooltip/index.tsx +0 -1
  200. package/src/components/Tooltip/Tooltip.stories.tsx +0 -41
  201. package/src/components/Tooltip/Tooltip.styles.ts +0 -5
  202. package/src/components/Tooltip/Tooltip.tsx +0 -46
  203. package/src/components/Tooltip/index.ts +0 -1
  204. package/src/screens/dashboard/DashboardsDetail.stories.tsx +0 -108
  205. package/src/utils/useResizeObserver.ts +0 -6
@@ -5,12 +5,12 @@ import { CSSInterpolation } from 'tss-react';
5
5
  import { equals } from 'ramda';
6
6
 
7
7
  import {
8
- ButtonProps,
8
+ ThemeProvider as MuiThemeProvider,
9
+ Theme,
10
+ StyledEngineProvider,
9
11
  createTheme,
10
12
  InputBaseProps,
11
- StyledEngineProvider,
12
- Theme,
13
- ThemeProvider as MuiThemeProvider
13
+ ButtonProps
14
14
  } from '@mui/material';
15
15
  import CssBaseline from '@mui/material/CssBaseline';
16
16
  import { autocompleteClasses } from '@mui/material/Autocomplete';
@@ -177,7 +177,6 @@ export const getTheme = (mode: ThemeMode): ThemeOptions => ({
177
177
  padding: 0;
178
178
  width: 100%;
179
179
  height: 100%;
180
- text-rendering: optimizeLegibility;
181
180
  }
182
181
  body {
183
182
  background-color: ${theme.palette.background.paper};
@@ -206,7 +205,7 @@ export const getTheme = (mode: ThemeMode): ThemeOptions => ({
206
205
  @font-face {
207
206
  font-family: 'Roboto';
208
207
  font-style: normal;
209
- font-weight: 700;
208
+ font-weight: 600;
210
209
  src: local('Roboto'), local('Roboto-Bold'), url(${RobotoBoldWoff2}) format('woff2');
211
210
  }
212
211
  `
@@ -1,385 +1,215 @@
1
- import { equals } from 'ramda';
2
-
3
- import { alpha, PaletteOptions } from '@mui/material';
4
-
5
- import { ThemeMode } from '@centreon/ui-context';
6
-
7
- import * as BaseTokens from '../base/tokens/themes/base.tokens';
8
-
9
- declare module '@mui/material/styles/createPalette' {
10
- interface TypeAction {
11
- acknowledged: string;
12
- acknowledgedBackground: string;
13
- inDowntime: string;
14
- inDowntimeBackground: string;
15
- }
16
- }
17
-
18
- declare module '@mui/material/styles' {
19
- interface Palette {
20
- background: TypeBackground;
21
- header: TypeHeader;
22
- layout: TypeLayout;
23
- menu: TypeMenu;
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
- header: TypeHeader;
40
- layout: TypeLayout;
41
- menu: TypeMenu;
42
- pending: {
43
- contrastText: string;
44
- main: string;
45
- };
46
- statusBackground: StatusBackground;
47
- }
48
-
49
- interface TypeBackground {
50
- default: string;
51
- listingHeader: string;
52
- panel: string;
53
- panelGroups: string;
54
- }
55
-
56
- interface TypeLayout {
57
- body: {
58
- background: string;
59
- };
60
- header: {
61
- background: string;
62
- border: string;
63
- };
64
- }
65
-
66
- interface TypeHeader {
67
- page: {
68
- action: {
69
- background: {
70
- active: string;
71
- default: string;
72
- };
73
- color: {
74
- active: string;
75
- default: string;
76
- };
77
- };
78
- border: string;
79
- description: string;
80
- title: string;
81
- };
82
- }
83
-
84
- interface TypeMenu {
85
- background: string;
86
- button: {
87
- background: {
88
- active: string;
89
- default: string;
90
- hover: string;
91
- };
92
- color: {
93
- active: string;
94
- default: string;
95
- hover: string;
96
- };
97
- };
98
- divider: {
99
- border: string;
100
- };
101
- item: {
102
- background: {
103
- active: string;
104
- default: string;
105
- hover: string;
106
- };
107
- color: {
108
- active: string;
109
- default: string;
110
- hover: string;
111
- };
112
- };
113
- }
114
- }
115
-
116
- declare module '@mui/material/Button' {
117
- interface ButtonPropsColorOverrides {
118
- pending: true;
119
- }
120
- }
121
-
122
- declare module '@mui/material/Badge' {
123
- interface BadgePropsColorOverrides {
124
- pending: true;
125
- }
126
- }
127
-
128
- export const lightPalette: PaletteOptions = {
129
- action: {
130
- acknowledged: '#67532C',
131
- acknowledgedBackground: '#F5F1E9',
132
- activatedOpacity: 0.12,
133
- active: '#666666',
134
- disabled: '#999999',
135
- disabledBackground: 'rgba(0, 0, 0, 0.12)',
136
- focus: 'rgba(0, 0, 0, 0.12)',
137
- focusOpacity: 0.12,
138
- hover: 'rgba(0, 0, 0, 0.06)',
139
- hoverOpacity: 0.06,
140
- inDowntime: '#4B2352',
141
- inDowntimeBackground: '#F0E9F8',
142
- selected: 'rgba(102, 102, 102, 0.3)',
143
- selectedOpacity: 0.3
144
- },
145
- background: {
146
- default: '#F4F4F4',
147
- listingHeader: '#666666',
148
- panel: '#EDEDED',
149
- panelGroups: '#F5F5F5',
150
- paper: '#FFFFFF'
151
- },
152
- divider: '#E3E3E3',
153
- error: {
154
- contrastText: '#000',
155
- main: '#FF4A4A'
156
- },
157
- header: {
158
- page: {
159
- action: {
160
- background: {
161
- active: '#1975D10F',
162
- default: '#FFFFFF00'
163
- },
164
- color: {
165
- active: '#1976D2',
166
- default: '#696969'
167
- }
168
- },
169
- border: '#4A4A4A',
170
- description: '#4A4A4A',
171
- title: '#000000'
172
- }
173
- },
174
- info: {
175
- contrastText: '#000',
176
- main: '#1588D1'
177
- },
178
- layout: {
179
- body: {
180
- background: '#F6F6F6'
181
- },
182
- header: {
183
- background: '#FFFFFF',
184
- border: '#E3E3E3'
185
- }
186
- },
187
- menu: {
188
- background: '#FFFFFF',
189
- button: {
190
- background: {
191
- active: BaseTokens.colorBlue50,
192
- default: 'transparent',
193
- hover: BaseTokens.colorGrey50
194
- },
195
- color: {
196
- active: BaseTokens.colorBlue400,
197
- default: BaseTokens.colorGrey400,
198
- hover: BaseTokens.colorGrey500
199
- }
200
- },
201
- divider: {
202
- border: BaseTokens.colorGrey200
203
- },
204
- item: {
205
- background: {
206
- active: BaseTokens.colorBlue50,
207
- default: 'transparent',
208
- hover: BaseTokens.colorGrey50
209
- },
210
- color: {
211
- active: BaseTokens.colorBlue400,
212
- default: BaseTokens.colorGrey900,
213
- hover: BaseTokens.colorGrey950
214
- }
215
- }
216
- },
217
- mode: ThemeMode.light,
218
- pending: {
219
- contrastText: '#000',
220
- main: '#1EBEB3'
221
- },
222
- primary: {
223
- contrastText: '#fff',
224
- dark: '#255891',
225
- light: '#cde7fc',
226
- main: '#2E68AA'
227
- },
228
- secondary: {
229
- contrastText: '#fff',
230
- dark: '#ac28c1',
231
- light: '#e5a5f0',
232
- main: '#C772D6'
233
- },
234
- statusBackground: {
235
- error: '#FF6666',
236
- none: alpha('#2E68AA', 0.1),
237
- pending: '#1EBEB3',
238
- success: '#88B922',
239
- unknown: '#E3E3E3',
240
- warning: '#FD9B27'
241
- },
242
- success: {
243
- contrastText: '#000',
244
- main: '#88B922'
245
- },
246
- text: {
247
- disabled: '#999999',
248
- primary: '#000000',
249
- secondary: '#666666'
250
- },
251
- warning: {
252
- contrastText: '#000',
253
- main: '#FD9B27'
254
- }
255
- };
256
-
257
- export const darkPalette: PaletteOptions = {
258
- action: {
259
- acknowledged: '#67532C',
260
- acknowledgedBackground: '#67532C',
261
- activatedOpacity: 0.3,
262
- active: '#B5B5B5',
263
- disabled: '#999999',
264
- disabledBackground: '#555555',
265
- focus: 'rgba(255, 255, 255, 0.30)',
266
- focusOpacity: 0.3,
267
- hover: 'rgba(255, 255, 255, 0.16)',
268
- hoverOpacity: 0.16,
269
- inDowntime: '#4B2352',
270
- inDowntimeBackground: '#4B2352',
271
- selected: 'rgba(255, 255, 255, 0.5)',
272
- selectedOpacity: 0.5
273
- },
274
- background: {
275
- default: '#4a4a4a',
276
- listingHeader: '#666666',
277
- panel: '#4a4a4a',
278
- panelGroups: '#252525',
279
- paper: '#212121'
280
- },
281
- divider: '#666666',
282
- error: {
283
- contrastText: '#fff',
284
- main: '#D60101'
285
- },
286
- header: {
287
- page: {
288
- action: {
289
- background: {
290
- active: '#1975D10F',
291
- default: '#FFFFFF00'
292
- },
293
- color: {
294
- active: '#1976D2',
295
- default: '#696969'
296
- }
297
- },
298
- border: '#bdbdbd',
299
- description: '#bdbdbd',
300
- title: '#fff'
301
- }
302
- },
303
- info: {
304
- contrastText: '#fff',
305
- main: '#1CA9F4'
306
- },
307
- layout: {
308
- body: {
309
- background: '#F6F6F6'
310
- },
311
- header: {
312
- background: '#FFFFFF',
313
- border: '#E3E3E3'
314
- }
315
- },
316
- menu: {
317
- background: BaseTokens.colorGrey950,
318
- button: {
319
- background: {
320
- active: BaseTokens.colorBlue950,
321
- default: 'transparent',
322
- hover: BaseTokens.colorGrey950
323
- },
324
- color: {
325
- active: BaseTokens.colorBlue600,
326
- default: BaseTokens.colorGrey600,
327
- hover: BaseTokens.colorGrey500
328
- }
329
- },
330
- divider: {
331
- border: BaseTokens.colorGrey800
332
- },
333
- item: {
334
- background: {
335
- active: BaseTokens.colorBlue950,
336
- default: 'transparent',
337
- hover: BaseTokens.colorGrey950
338
- },
339
- color: {
340
- active: BaseTokens.colorBlue400,
341
- default: BaseTokens.colorGrey50,
342
- hover: '#fff'
343
- }
344
- }
345
- },
346
- mode: ThemeMode.dark,
347
- pending: {
348
- contrastText: '#fff',
349
- main: '#118077'
350
- },
351
- primary: {
352
- contrastText: '#000',
353
- dark: '#4974A5',
354
- light: '#8bbff9',
355
- main: '#6eaff8'
356
- },
357
- secondary: {
358
- contrastText: '#fff',
359
- main: '#7C1FA2'
360
- },
361
- statusBackground: {
362
- error: '#D60101',
363
- none: alpha('#2E68AA', 0.1),
364
- pending: '#118077',
365
- success: '#5F8118',
366
- unknown: '#666666',
367
- warning: '#C55400'
368
- },
369
- success: {
370
- contrastText: '#fff',
371
- main: '#5F8118'
372
- },
373
- text: {
374
- disabled: '#666666',
375
- primary: '#FFFFFF',
376
- secondary: '#CCCCCC'
377
- },
378
- warning: {
379
- contrastText: '#fff',
380
- main: '#C55400'
381
- }
382
- };
383
-
384
- export const getPalette = (mode: ThemeMode): PaletteOptions =>
385
- equals(mode, ThemeMode.dark) ? darkPalette : lightPalette;
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
+ panel: string;
22
+ panelGroups: string;
23
+ paper: string;
24
+ tooltip: string;
25
+ };
26
+ pending: {
27
+ contrastText: string;
28
+ main: string;
29
+ };
30
+ statusBackground: StatusBackground;
31
+ }
32
+ interface StatusBackground {
33
+ error: string;
34
+ none: string;
35
+ pending: string;
36
+ success: string;
37
+ unknown: string;
38
+ warning: string;
39
+ }
40
+ interface PaletteOptions {
41
+ pending: {
42
+ contrastText: string;
43
+ main: string;
44
+ };
45
+ statusBackground: StatusBackground;
46
+ }
47
+
48
+ interface TypeBackground {
49
+ default: string;
50
+ listingHeader: string;
51
+ panel: string;
52
+ panelGroups: string;
53
+ paper: string;
54
+ tooltip: string;
55
+ }
56
+ }
57
+
58
+ declare module '@mui/material/Button' {
59
+ interface ButtonPropsColorOverrides {
60
+ pending: true;
61
+ }
62
+ }
63
+
64
+ declare module '@mui/material/Badge' {
65
+ interface BadgePropsColorOverrides {
66
+ pending: true;
67
+ }
68
+ }
69
+
70
+ export const lightPalette: PaletteOptions = {
71
+ action: {
72
+ acknowledged: '#67532C',
73
+ acknowledgedBackground: '#F5F1E9',
74
+ activatedOpacity: 0.12,
75
+ active: '#666666',
76
+ disabled: '#999999',
77
+ disabledBackground: 'rgba(0, 0, 0, 0.12)',
78
+ focus: 'rgba(0, 0, 0, 0.12)',
79
+ focusOpacity: 0.12,
80
+ hover: 'rgba(0, 0, 0, 0.06)',
81
+ hoverOpacity: 0.06,
82
+ inDowntime: '#4B2352',
83
+ inDowntimeBackground: '#F0E9F8',
84
+ selected: 'rgba(102, 102, 102, 0.3)',
85
+ selectedOpacity: 0.3
86
+ },
87
+ background: {
88
+ default: '#F4F4F4',
89
+ listingHeader: '#666666',
90
+ panel: '#EDEDED',
91
+ panelGroups: '#F5F5F5',
92
+ paper: '#FFFFFF',
93
+ tooltip: '#434E5B'
94
+ },
95
+ divider: '#E3E3E3',
96
+ error: {
97
+ contrastText: '#000',
98
+ main: '#FF4A4A'
99
+ },
100
+ info: {
101
+ contrastText: '#000',
102
+ main: '#1588D1'
103
+ },
104
+ mode: ThemeMode.light,
105
+ pending: {
106
+ contrastText: '#000',
107
+ main: '#1EBEB3'
108
+ },
109
+ primary: {
110
+ contrastText: '#fff',
111
+ dark: '#255891',
112
+ light: '#cde7fc',
113
+ main: '#2E68AA'
114
+ },
115
+ secondary: {
116
+ contrastText: '#fff',
117
+ main: '#C772D6'
118
+ },
119
+ statusBackground: {
120
+ error: '#FF6666',
121
+ none: alpha('#2E68AA', 0.1),
122
+ pending: '#1EBEB3',
123
+ success: '#88B922',
124
+ unknown: '#E3E3E3',
125
+ warning: '#FD9B27'
126
+ },
127
+ success: {
128
+ contrastText: '#000',
129
+ main: '#88B922'
130
+ },
131
+ text: {
132
+ disabled: '#999999',
133
+ primary: '#000000',
134
+ secondary: '#666666'
135
+ },
136
+ warning: {
137
+ contrastText: '#000',
138
+ main: '#FD9B27'
139
+ }
140
+ };
141
+
142
+ export const darkPalette: PaletteOptions = {
143
+ action: {
144
+ acknowledged: '#67532C',
145
+ acknowledgedBackground: '#67532C',
146
+ activatedOpacity: 0.3,
147
+ active: '#B5B5B5',
148
+ disabled: '#999999',
149
+ disabledBackground: '#555555',
150
+ focus: 'rgba(255, 255, 255, 0.30)',
151
+ focusOpacity: 0.3,
152
+ hover: 'rgba(255, 255, 255, 0.16)',
153
+ hoverOpacity: 0.16,
154
+ inDowntime: '#4B2352',
155
+ inDowntimeBackground: '#4B2352',
156
+ selected: 'rgba(255, 255, 255, 0.5)',
157
+ selectedOpacity: 0.5
158
+ },
159
+ background: {
160
+ default: '#4a4a4a',
161
+ listingHeader: '#666666',
162
+ panel: '#4a4a4a',
163
+ panelGroups: '#252525',
164
+ paper: '#212121',
165
+ tooltip: '#AAB4C0'
166
+ },
167
+ divider: '#666666',
168
+ error: {
169
+ contrastText: '#fff',
170
+ main: '#D60101'
171
+ },
172
+ info: {
173
+ contrastText: '#fff',
174
+ main: '#1CA9F4'
175
+ },
176
+ mode: ThemeMode.dark,
177
+ pending: {
178
+ contrastText: '#fff',
179
+ main: '#118077'
180
+ },
181
+ primary: {
182
+ contrastText: '#000',
183
+ dark: '#4974A5',
184
+ light: '#8bbff9',
185
+ main: '#6eaff8'
186
+ },
187
+ secondary: {
188
+ contrastText: '#fff',
189
+ main: '#7C1FA2'
190
+ },
191
+ statusBackground: {
192
+ error: '#D60101',
193
+ none: alpha('#2E68AA', 0.1),
194
+ pending: '#118077',
195
+ success: '#5F8118',
196
+ unknown: '#666666',
197
+ warning: '#C55400'
198
+ },
199
+ success: {
200
+ contrastText: '#fff',
201
+ main: '#5F8118'
202
+ },
203
+ text: {
204
+ disabled: '#666666',
205
+ primary: '#FFFFFF',
206
+ secondary: '#CCCCCC'
207
+ },
208
+ warning: {
209
+ contrastText: '#fff',
210
+ main: '#C55400'
211
+ }
212
+ };
213
+
214
+ export const getPalette = (mode: ThemeMode): PaletteOptions =>
215
+ equals(mode, ThemeMode.dark) ? darkPalette : lightPalette;
@@ -0,0 +1,51 @@
1
+ import { makeStyles } from 'tss-react/mui';
2
+
3
+ const useStyles = makeStyles()((theme) => ({
4
+ button: {
5
+ height: '100%',
6
+ padding: theme.spacing(0, 0.5)
7
+ },
8
+ buttonContent: {
9
+ alignItems: 'center',
10
+ columnGap: theme.spacing(1),
11
+ display: 'flex'
12
+ },
13
+ containerDates: {
14
+ display: 'flex',
15
+ gap: theme.spacing(0.5),
16
+ [theme.breakpoints.down('sm')]: {
17
+ columnGap: theme.spacing(0.5),
18
+ flexDirection: 'column'
19
+ }
20
+ },
21
+ date: {
22
+ minWidth: theme.spacing(12.5),
23
+ textAlign: 'start'
24
+ },
25
+ error: {
26
+ textAlign: 'center'
27
+ },
28
+ label: {
29
+ minWidth: theme.spacing(3),
30
+ textAlign: 'start'
31
+ },
32
+
33
+ picker: {
34
+ display: 'flex',
35
+ flexDirection: 'column',
36
+ gap: theme.spacing(1),
37
+ justifyItems: 'center',
38
+ padding: theme.spacing(1, 2)
39
+ },
40
+ timeContainer: {
41
+ alignItems: 'center',
42
+ columnGap: theme.spacing(1),
43
+ display: 'flex',
44
+ flexDirection: 'row',
45
+ [theme.breakpoints.down('sm')]: {
46
+ alignItems: 'flex-start'
47
+ }
48
+ }
49
+ }));
50
+
51
+ export default useStyles;