@centreon/ui 23.10.25-feature-MON-19319.0 → 23.10.25
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 +1 -8
- package/src/Button/Save/index.stories.tsx +10 -5
- package/src/Dashboard/DashboardLayout.stories.tsx +5 -3
- package/src/Dashboard/Layout.tsx +4 -4
- package/src/Dashboard/utils.ts +28 -28
- package/src/ThemeProvider/index.tsx +5 -6
- package/src/ThemeProvider/palettes.ts +208 -234
- package/src/components/Button/Button.styles.ts +2 -7
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Form/Dashboard/Dashboard.resource.ts +1 -1
- package/src/components/Form/Dashboard/DashboardForm.tsx +10 -6
- package/src/components/Form/Dashboard/translatedLabels.ts +1 -0
- package/src/components/Header/Header.stories.tsx +27 -0
- package/src/components/Header/Header.styles.ts +27 -0
- package/src/components/Header/Header.tsx +23 -0
- package/src/components/Header/index.ts +1 -1
- package/src/components/index.ts +0 -2
- package/src/index.ts +2 -0
- package/src/layout/TiledListingPage/TiledListingActions.tsx +15 -0
- package/src/layout/TiledListingPage/TiledListingContent.tsx +21 -0
- package/src/layout/TiledListingPage/TiledListingList.tsx +11 -0
- package/src/layout/TiledListingPage/TiledListingPage.styles.ts +16 -0
- package/src/layout/TiledListingPage/TiledListingPage.tsx +15 -0
- package/src/layout/TiledListingPage/index.ts +4 -0
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +101 -109
- package/test/setupTests.js +20 -23
- package/src/components/Header/PageHeader/PageHeader.stories.tsx +0 -83
- package/src/components/Header/PageHeader/PageHeader.styles.ts +0 -105
- package/src/components/Header/PageHeader/PageHeader.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderActions.tsx +0 -17
- package/src/components/Header/PageHeader/PageHeaderMain.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderMenu.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderTitle.tsx +0 -44
- package/src/components/Header/PageHeader/index.ts +0 -12
- package/src/components/Layout/AreaIndicator.styles.ts +0 -33
- package/src/components/Layout/AreaIndicator.tsx +0 -35
- package/src/components/Layout/PageLayout/PageLayout.stories.tsx +0 -81
- package/src/components/Layout/PageLayout/PageLayout.styles.ts +0 -30
- package/src/components/Layout/PageLayout/PageLayout.tsx +0 -21
- package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -15
- package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -24
- package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +0 -15
- package/src/components/Layout/PageLayout/index.ts +0 -10
- package/src/components/Layout/index.ts +0 -1
- package/src/components/Menu/Menu.tsx +0 -0
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.stories.tsx +0 -71
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.styles.ts +0 -5
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +0 -115
- package/src/components/Tooltip/TextOverflowTooltip/index.tsx +0 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -41
- package/src/components/Tooltip/Tooltip.styles.ts +0 -5
- package/src/components/Tooltip/Tooltip.tsx +0 -46
- package/src/components/Tooltip/index.ts +0 -1
- package/src/utils/useResizeObserver.ts +0 -6
|
@@ -1,234 +1,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
|
-
|
|
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
|
-
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;
|
|
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
|
+
info: {
|
|
166
|
+
contrastText: '#fff',
|
|
167
|
+
main: '#1CA9F4'
|
|
168
|
+
},
|
|
169
|
+
mode: ThemeMode.dark,
|
|
170
|
+
pending: {
|
|
171
|
+
contrastText: '#fff',
|
|
172
|
+
main: '#118077'
|
|
173
|
+
},
|
|
174
|
+
primary: {
|
|
175
|
+
contrastText: '#000',
|
|
176
|
+
dark: '#4974A5',
|
|
177
|
+
light: '#8bbff9',
|
|
178
|
+
main: '#6eaff8'
|
|
179
|
+
},
|
|
180
|
+
secondary: {
|
|
181
|
+
contrastText: '#fff',
|
|
182
|
+
main: '#7C1FA2'
|
|
183
|
+
},
|
|
184
|
+
statusBackground: {
|
|
185
|
+
error: '#D60101',
|
|
186
|
+
none: alpha('#2E68AA', 0.1),
|
|
187
|
+
pending: '#118077',
|
|
188
|
+
success: '#5F8118',
|
|
189
|
+
unknown: '#666666',
|
|
190
|
+
warning: '#C55400'
|
|
191
|
+
},
|
|
192
|
+
success: {
|
|
193
|
+
contrastText: '#fff',
|
|
194
|
+
main: '#5F8118'
|
|
195
|
+
},
|
|
196
|
+
text: {
|
|
197
|
+
disabled: '#666666',
|
|
198
|
+
primary: '#FFFFFF',
|
|
199
|
+
secondary: '#CCCCCC'
|
|
200
|
+
},
|
|
201
|
+
warning: {
|
|
202
|
+
contrastText: '#fff',
|
|
203
|
+
main: '#C55400'
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export const getPalette = (mode: ThemeMode): PaletteOptions =>
|
|
208
|
+
equals(mode, ThemeMode.dark) ? darkPalette : lightPalette;
|
|
@@ -3,13 +3,8 @@ import { makeStyles } from 'tss-react/mui';
|
|
|
3
3
|
const useStyles = makeStyles()((theme) => ({
|
|
4
4
|
button: {
|
|
5
5
|
'&[data-size="small"]': {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
paddingRight: theme.spacing(2)
|
|
9
|
-
},
|
|
10
|
-
fontSize: '14px',
|
|
11
|
-
height: 'unset',
|
|
12
|
-
lineHeight: '22px'
|
|
6
|
+
paddingLeft: theme.spacing(2),
|
|
7
|
+
paddingRight: theme.spacing(2)
|
|
13
8
|
},
|
|
14
9
|
|
|
15
10
|
'&[data-variant="primary"]:not(:disabled)': {
|
|
@@ -11,7 +11,8 @@ import { useStyles } from './DashboardForm.styles';
|
|
|
11
11
|
import {
|
|
12
12
|
labelMustBeAtLeast,
|
|
13
13
|
labelMustBeMost,
|
|
14
|
-
labelRequired
|
|
14
|
+
labelRequired,
|
|
15
|
+
labelCharacters
|
|
15
16
|
} from './translatedLabels';
|
|
16
17
|
import {
|
|
17
18
|
DashboardFormActions,
|
|
@@ -43,7 +44,7 @@ const DashboardForm = ({
|
|
|
43
44
|
|
|
44
45
|
const formProps = useMemo<FormProps<DashboardResource>>(
|
|
45
46
|
() => ({
|
|
46
|
-
initialValues: resource ?? { name: '' },
|
|
47
|
+
initialValues: resource ?? { description: null, name: '' },
|
|
47
48
|
inputs: [
|
|
48
49
|
{
|
|
49
50
|
fieldName: 'name',
|
|
@@ -55,7 +56,7 @@ const DashboardForm = ({
|
|
|
55
56
|
{
|
|
56
57
|
fieldName: 'description',
|
|
57
58
|
group: 'main',
|
|
58
|
-
label: labels?.entity?.description,
|
|
59
|
+
label: labels?.entity?.description || '',
|
|
59
60
|
text: {
|
|
60
61
|
multilineRows: 3
|
|
61
62
|
},
|
|
@@ -65,9 +66,12 @@ const DashboardForm = ({
|
|
|
65
66
|
submit: (values, bag) => onSubmit?.(values, bag),
|
|
66
67
|
validationSchema: Yup.object().shape({
|
|
67
68
|
description: Yup.string()
|
|
68
|
-
.label(labels?.entity?.description)
|
|
69
|
-
.max(
|
|
70
|
-
|
|
69
|
+
.label(labels?.entity?.description || '')
|
|
70
|
+
.max(
|
|
71
|
+
180,
|
|
72
|
+
(p) =>
|
|
73
|
+
`${p.label} ${t(labelMustBeMost)} ${p.max} ${t(labelCharacters)}`
|
|
74
|
+
)
|
|
71
75
|
.nullable(),
|
|
72
76
|
name: Yup.string()
|
|
73
77
|
.label(labels?.entity?.name)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { Settings as SettingsIcon } from '@mui/icons-material';
|
|
4
|
+
|
|
5
|
+
import { IconButton } from '../Button';
|
|
6
|
+
|
|
7
|
+
import { Header } from './Header';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof Header> = {
|
|
10
|
+
component: Header
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof Header>;
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
title: 'Header'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const WithNav: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
nav: <IconButton icon={<SettingsIcon />} size="small" variant="ghost" />,
|
|
25
|
+
title: 'Header with nav'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { makeStyles } from 'tss-react/mui';
|
|
2
|
+
|
|
3
|
+
const useStyles = makeStyles()((theme) => ({
|
|
4
|
+
header: {
|
|
5
|
+
alignItems: 'flex-start',
|
|
6
|
+
borderBottom: `1px solid ${theme.palette.primary.main}`,
|
|
7
|
+
display: 'flex',
|
|
8
|
+
flexDirection: 'row',
|
|
9
|
+
h1: {
|
|
10
|
+
font: 'normal normal 600 24px/24px Roboto',
|
|
11
|
+
letterSpacing: '0.18px',
|
|
12
|
+
margin: theme.spacing(0, 0, 1.5, 0)
|
|
13
|
+
},
|
|
14
|
+
justifyContent: 'space-between',
|
|
15
|
+
marginBottom: theme.spacing(2.5),
|
|
16
|
+
|
|
17
|
+
nav: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
gap: theme.spacing(1),
|
|
20
|
+
justifyContent: 'flex-end'
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
padding: theme.spacing(0, 0, 1.5, 0)
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
export { useStyles };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Typography as MuiTypography } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
import { useStyles } from './Header.styles';
|
|
6
|
+
|
|
7
|
+
type HeaderProps = {
|
|
8
|
+
nav?: ReactNode;
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Header = ({ title, nav }: HeaderProps): ReactElement => {
|
|
13
|
+
const { classes } = useStyles();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<header className={classes.header}>
|
|
17
|
+
<MuiTypography variant="h1">{title}</MuiTypography>
|
|
18
|
+
{nav && <nav>{nav}</nav>}
|
|
19
|
+
</header>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { Header };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './Header';
|
package/src/components/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -140,6 +140,8 @@ export { default as ActionsList } from './ActionsList';
|
|
|
140
140
|
|
|
141
141
|
export type { ResponseError, CatchErrorProps } from './api/customFetch';
|
|
142
142
|
|
|
143
|
+
export * from './layout/TiledListingPage';
|
|
144
|
+
|
|
143
145
|
export * from './utils';
|
|
144
146
|
export { default as FluidTypography } from './Typography/FluidTypography';
|
|
145
147
|
export * from './Dashboard';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTiledListingActionsStyles } from './TiledListingPage.styles';
|
|
4
|
+
|
|
5
|
+
interface TiledListingActionsProps {
|
|
6
|
+
children: Array<ReactNode> | ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const TiledListingActions = ({
|
|
10
|
+
children
|
|
11
|
+
}: TiledListingActionsProps): JSX.Element => {
|
|
12
|
+
const { classes } = useTiledListingActionsStyles();
|
|
13
|
+
|
|
14
|
+
return <div className={classes.actions}>{children}</div>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import Responsive from '../../Responsive';
|
|
4
|
+
|
|
5
|
+
import { useTiledListingActionsStyles } from './TiledListingPage.styles';
|
|
6
|
+
|
|
7
|
+
interface TiledListingContentProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const TiledListingContent = ({
|
|
12
|
+
children
|
|
13
|
+
}: TiledListingContentProps): JSX.Element => {
|
|
14
|
+
const { classes } = useTiledListingActionsStyles();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Responsive>
|
|
18
|
+
<div className={classes.actions}>{children}</div>
|
|
19
|
+
</Responsive>
|
|
20
|
+
);
|
|
21
|
+
};
|