@centreon/ui 23.10.32-MON-19938-cloud-notifications-fix-search-select-boxes.2 → 23.10.32

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 (92) hide show
  1. package/package.json +2 -12
  2. package/src/Dashboard/DashboardLayout.stories.tsx +5 -3
  3. package/src/Dashboard/Layout.tsx +4 -4
  4. package/src/Dashboard/utils.ts +28 -28
  5. package/src/Form/Inputs/ConnectedAutocomplete.tsx +3 -13
  6. package/src/Form/Inputs/models.ts +0 -13
  7. package/src/InputField/Select/Autocomplete/Connected/index.tsx +0 -10
  8. package/src/ThemeProvider/index.tsx +5 -6
  9. package/src/ThemeProvider/palettes.ts +215 -389
  10. package/src/api/TestQueryProvider.tsx +1 -2
  11. package/src/api/useFetchQuery/index.ts +7 -8
  12. package/src/api/useMutationQuery/index.ts +10 -11
  13. package/src/components/Button/Button.styles.ts +3 -17
  14. package/src/components/Button/Button.tsx +3 -6
  15. package/src/components/Button/Icon/IconButton.styles.ts +2 -9
  16. package/src/components/DataTable/DataTable.stories.tsx +0 -9
  17. package/src/components/DataTable/DataTable.styles.ts +0 -5
  18. package/src/components/DataTable/DataTable.tsx +6 -8
  19. package/src/components/DataTable/EmptyState/DataTableEmptyState.tsx +1 -4
  20. package/src/components/DataTable/Item/DataTableItem.styles.ts +2 -5
  21. package/src/components/DataTable/Item/DataTableItem.tsx +18 -36
  22. package/src/components/Header/Header.stories.tsx +27 -0
  23. package/src/components/Header/Header.styles.ts +27 -0
  24. package/src/components/Header/Header.tsx +23 -0
  25. package/src/components/Header/index.ts +1 -1
  26. package/src/components/Modal/index.ts +0 -2
  27. package/src/components/index.ts +0 -3
  28. package/src/index.ts +2 -0
  29. package/src/layout/TiledListingPage/TiledListingActions.tsx +15 -0
  30. package/src/layout/TiledListingPage/TiledListingContent.tsx +21 -0
  31. package/src/layout/TiledListingPage/TiledListingList.tsx +11 -0
  32. package/src/layout/TiledListingPage/TiledListingPage.styles.ts +16 -0
  33. package/src/layout/TiledListingPage/TiledListingPage.tsx +15 -0
  34. package/src/layout/TiledListingPage/index.ts +4 -0
  35. package/src/screens/dashboard/DashboardsOverview.stories.tsx +102 -110
  36. package/src/utils/index.ts +1 -1
  37. package/src/utils/sanitizedHTML.ts +1 -1
  38. package/test/setupTests.js +1 -1
  39. package/src/base/tokens/README.md +0 -3
  40. package/src/base/tokens/source/$metadata.json +0 -5
  41. package/src/base/tokens/source/base.json +0 -142
  42. package/src/base/tokens/themes/base.tokens.d.ts +0 -38
  43. package/src/base/tokens/themes/base.tokens.json +0 -695
  44. package/src/base/tokens/themes/base.tokens.ts +0 -38
  45. package/src/base/tokens/themes/ui-dark.tokens.d.ts +0 -38
  46. package/src/base/tokens/themes/ui-dark.tokens.json +0 -695
  47. package/src/base/tokens/themes/ui-dark.tokens.ts +0 -38
  48. package/src/base/tokens/themes/ui-light.tokens.d.ts +0 -38
  49. package/src/base/tokens/themes/ui-light.tokens.json +0 -695
  50. package/src/base/tokens/themes/ui-light.tokens.ts +0 -38
  51. package/src/components/Header/PageHeader/PageHeader.stories.tsx +0 -88
  52. package/src/components/Header/PageHeader/PageHeader.styles.ts +0 -99
  53. package/src/components/Header/PageHeader/PageHeader.tsx +0 -15
  54. package/src/components/Header/PageHeader/PageHeaderActions.tsx +0 -17
  55. package/src/components/Header/PageHeader/PageHeaderMain.tsx +0 -15
  56. package/src/components/Header/PageHeader/PageHeaderMenu.tsx +0 -15
  57. package/src/components/Header/PageHeader/PageHeaderTitle.tsx +0 -47
  58. package/src/components/Header/PageHeader/index.ts +0 -12
  59. package/src/components/Layout/AreaIndicator.styles.ts +0 -33
  60. package/src/components/Layout/AreaIndicator.tsx +0 -35
  61. package/src/components/Layout/PageLayout/PageLayout.stories.tsx +0 -81
  62. package/src/components/Layout/PageLayout/PageLayout.styles.ts +0 -40
  63. package/src/components/Layout/PageLayout/PageLayout.tsx +0 -21
  64. package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -15
  65. package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -24
  66. package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +0 -15
  67. package/src/components/Layout/PageLayout/index.ts +0 -10
  68. package/src/components/Layout/index.ts +0 -1
  69. package/src/components/Menu/Button/MenuButton.stories.tsx +0 -16
  70. package/src/components/Menu/Button/MenuButton.styles.ts +0 -27
  71. package/src/components/Menu/Button/MenuButton.tsx +0 -62
  72. package/src/components/Menu/Button/index.ts +0 -1
  73. package/src/components/Menu/Menu.stories.tsx +0 -71
  74. package/src/components/Menu/Menu.styles.ts +0 -70
  75. package/src/components/Menu/Menu.tsx +0 -25
  76. package/src/components/Menu/MenuDivider.tsx +0 -13
  77. package/src/components/Menu/MenuItem.tsx +0 -36
  78. package/src/components/Menu/MenuItems.tsx +0 -35
  79. package/src/components/Menu/index.ts +0 -12
  80. package/src/components/Menu/useMenu.tsx +0 -79
  81. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.stories.tsx +0 -70
  82. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.styles.ts +0 -5
  83. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +0 -115
  84. package/src/components/Tooltip/TextOverflowTooltip/index.tsx +0 -1
  85. package/src/components/Tooltip/Tooltip.stories.tsx +0 -41
  86. package/src/components/Tooltip/Tooltip.styles.ts +0 -5
  87. package/src/components/Tooltip/Tooltip.tsx +0 -46
  88. package/src/components/Tooltip/index.ts +0 -1
  89. package/src/screens/dashboard/DashboardsDetail.stories.tsx +0 -108
  90. package/src/styles/tokens/themes/_ui-dark.tokens.json +0 -695
  91. package/src/styles/tokens/themes/_ui-light.tokens.json +0 -695
  92. package/src/utils/useResizeObserver.ts +0 -6
@@ -11,11 +11,16 @@ import {
11
11
  DashboardForm,
12
12
  DashboardFormProps,
13
13
  DataTable,
14
- Modal,
15
- PageHeader,
16
- PageLayout
14
+ Header,
15
+ Modal
17
16
  } from '../../components';
18
17
  import { Default as DashboardFormDefaultStory } from '../../components/Form/Dashboard/DashboardForm.stories';
18
+ import {
19
+ TiledListingActions,
20
+ TiledListingContent,
21
+ TiledListingList,
22
+ TiledListingPage
23
+ } from '../../layout/TiledListingPage';
19
24
 
20
25
  const meta: Meta = {
21
26
  args: {
@@ -59,10 +64,7 @@ const meta: Meta = {
59
64
  },
60
65
  title: 'Dashboards overview'
61
66
  },
62
- parameters: {
63
- layout: 'fullscreen'
64
- },
65
- title: 'screens/Dashboards overview'
67
+ title: 'screens/Dashboards'
66
68
  };
67
69
 
68
70
  export default meta;
@@ -132,16 +134,10 @@ const DefaultView = (args): JSX.Element => {
132
134
  };
133
135
 
134
136
  return (
135
- <PageLayout>
136
- <PageLayout.Header>
137
- <PageHeader>
138
- <PageHeader.Main>
139
- <PageHeader.Title title={title} />
140
- </PageHeader.Main>
141
- </PageHeader>
142
- </PageLayout.Header>
143
- <PageLayout.Body>
144
- <PageLayout.Actions>
137
+ <TiledListingPage>
138
+ <Header title={title} />
139
+ <TiledListingList>
140
+ <TiledListingActions>
145
141
  {dataDashboards.length !== 0 && (
146
142
  <Button
147
143
  aria-label="add"
@@ -154,105 +150,101 @@ const DefaultView = (args): JSX.Element => {
154
150
  {actions.create.label}
155
151
  </Button>
156
152
  )}
157
- </PageLayout.Actions>
158
-
159
- <DataTable isEmpty={dataDashboards.length === 0}>
160
- {dataDashboards.length === 0 ? (
161
- <DataTable.EmptyState
162
- labels={list.emptyState.labels}
163
- onCreate={() =>
153
+ </TiledListingActions>
154
+ <TiledListingContent>
155
+ <DataTable isEmpty={dataDashboards.length === 0}>
156
+ {dataDashboards.length === 0 ? (
157
+ <DataTable.EmptyState
158
+ labels={list.emptyState.labels}
159
+ onCreate={() =>
160
+ setDialogState({ item: null, open: true, variant: 'create' })
161
+ }
162
+ />
163
+ ) : (
164
+ dataDashboards.map((dashboard) => (
165
+ <DataTable.Item
166
+ hasActions
167
+ hasCardAction
168
+ description={dashboard.description}
169
+ key={dashboard.id}
170
+ title={dashboard.name}
171
+ onDelete={() =>
172
+ setDeleteDialogState({ item: dashboard, open: true })
173
+ }
174
+ onEdit={() =>
175
+ setDialogState({
176
+ item: dashboard,
177
+ open: true,
178
+ variant: 'update'
179
+ })
180
+ }
181
+ />
182
+ ))
183
+ )}
184
+ </DataTable>
185
+ </TiledListingContent>
186
+ <Modal
187
+ open={dialogState.open}
188
+ onClose={() =>
189
+ setDialogState({
190
+ item: null,
191
+ open: false,
192
+ variant: dialogState.variant
193
+ })
194
+ }
195
+ >
196
+ <Modal.Header>
197
+ {form.labels.title[dialogState.variant ?? 'create']}
198
+ </Modal.Header>
199
+ <Modal.Body>
200
+ <DashboardForm
201
+ labels={DashboardFormDefaultStory!.args!.labels!}
202
+ resource={dialogState.item || undefined}
203
+ variant={dialogState.variant}
204
+ onCancel={() =>
164
205
  setDialogState({
165
206
  item: null,
166
- open: true,
167
- variant: 'create'
207
+ open: false,
208
+ variant: dialogState.variant
168
209
  })
169
210
  }
211
+ onSubmit={(values) =>
212
+ dialogState.variant === 'create'
213
+ ? createDashboard(values)
214
+ : updateDashboard(values)
215
+ }
170
216
  />
171
- ) : (
172
- dataDashboards.map((dashboard) => (
173
- <DataTable.Item
174
- hasActions
175
- hasCardAction
176
- description={dashboard.description}
177
- key={dashboard.id}
178
- title={dashboard.name}
179
- onDelete={() =>
180
- setDeleteDialogState({ item: dashboard, open: true })
181
- }
182
- onEdit={() =>
183
- setDialogState({
184
- item: dashboard,
185
- open: true,
186
- variant: 'update'
187
- })
188
- }
189
- />
190
- ))
191
- )}
192
- </DataTable>
193
- </PageLayout.Body>
194
-
195
- <Modal
196
- open={dialogState.open}
197
- onClose={() =>
198
- setDialogState({
199
- item: null,
200
- open: false,
201
- variant: dialogState.variant
202
- })
203
- }
204
- >
205
- <Modal.Header>
206
- {form.labels.title[dialogState.variant ?? 'create']}
207
- </Modal.Header>
208
- <Modal.Body>
209
- <DashboardForm
210
- labels={DashboardFormDefaultStory!.args!.labels!}
211
- resource={dialogState.item || undefined}
212
- variant={dialogState.variant}
213
- onCancel={() =>
214
- setDialogState({
215
- item: null,
216
- open: false,
217
- variant: dialogState.variant
218
- })
219
- }
220
- onSubmit={(values) =>
221
- dialogState.variant === 'create'
222
- ? createDashboard(values)
223
- : updateDashboard(values)
224
- }
217
+ </Modal.Body>
218
+ </Modal>
219
+ <Modal
220
+ open={deleteDialogState.open}
221
+ onClose={() =>
222
+ setDeleteDialogState({
223
+ ...deleteDialogState,
224
+ open: false
225
+ })
226
+ }
227
+ >
228
+ <Modal.Header>{deleteConfirmation.labels.title}</Modal.Header>
229
+ <Modal.Body>
230
+ <p>
231
+ {deleteConfirmation.labels.description(
232
+ deleteDialogState.item?.name
233
+ )}
234
+ </p>
235
+ </Modal.Body>
236
+ <Modal.Actions
237
+ isDanger
238
+ labels={deleteConfirmation.labels.actions}
239
+ onCancel={() => setDeleteDialogState({ item: null, open: false })}
240
+ onConfirm={() => {
241
+ deleteDashboard(deleteDialogState.item?.id);
242
+ setDeleteDialogState({ item: null, open: false });
243
+ }}
225
244
  />
226
- </Modal.Body>
227
- </Modal>
228
- <Modal
229
- open={deleteDialogState.open}
230
- onClose={() =>
231
- setDeleteDialogState({
232
- ...deleteDialogState,
233
- open: false
234
- })
235
- }
236
- >
237
- <Modal.Header>{deleteConfirmation.labels.title}</Modal.Header>
238
- <Modal.Body>
239
- <p>
240
- {deleteConfirmation.labels.description(
241
- deleteDialogState.item?.name
242
- )}
243
- </p>
244
- </Modal.Body>
245
- <Modal.Actions
246
- isDanger
247
- labels={deleteConfirmation.labels.actions}
248
- onCancel={() => setDeleteDialogState({ item: null, open: false })}
249
- onConfirm={() => {
250
- deleteDashboard(deleteDialogState.item?.id);
251
- setDeleteDialogState({ item: null, open: false });
252
- }}
253
- />
254
- </Modal>
255
- </PageLayout>
245
+ </Modal>
246
+ </TiledListingList>
247
+ </TiledListingPage>
256
248
  );
257
249
  };
258
250
 
@@ -14,4 +14,4 @@ export * from './useMemoComponent';
14
14
  export * from './useThemeMode';
15
15
  export * from './useViewportIntersection';
16
16
  export * from './panelSize';
17
- export * from './sanitizedHTML';
17
+ export { default as sanitizedHTML } from './sanitizedHTML';
@@ -15,4 +15,4 @@ const sanitizedHTML = ({
15
15
  return ReactHtmlParser(sanitizedContent);
16
16
  };
17
17
 
18
- export { sanitizedHTML };
18
+ export default sanitizedHTML;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-underscore-dangle */
2
2
  /* eslint-disable no-undef */
3
-
3
+ // import '@testing-library/jest-dom/extend-expect';
4
4
  import i18n from 'i18next';
5
5
  import { initReactI18next } from 'react-i18next';
6
6
  import fetchMock from 'jest-fetch-mock';
@@ -1,3 +0,0 @@
1
- `// TODO`
2
-
3
- - [ ] integrate design tokens with MUI ThemeProvider
@@ -1,5 +0,0 @@
1
- {
2
- "tokenSetOrder": [
3
- "base"
4
- ]
5
- }
@@ -1,142 +0,0 @@
1
- {
2
- "color": {
3
- "blue": {
4
- "50": {
5
- "value": "#ECF4FD",
6
- "type": "color"
7
- },
8
- "100": {
9
- "value": "#D2E4F9",
10
- "type": "color"
11
- },
12
- "200": {
13
- "value": "#9EC4F0",
14
- "type": "color"
15
- },
16
- "300": {
17
- "value": "#6DA4E4",
18
- "type": "color"
19
- },
20
- "400": {
21
- "value": "#3e85d5",
22
- "type": "color"
23
- },
24
- "500": {
25
- "value": "#2e68aa",
26
- "type": "color"
27
- },
28
- "600": {
29
- "value": "#205593",
30
- "type": "color"
31
- },
32
- "700": {
33
- "value": "#164274",
34
- "type": "color"
35
- },
36
- "800": {
37
- "value": "#0d2e54",
38
- "type": "color"
39
- },
40
- "900": {
41
- "value": "#071d37",
42
- "type": "color"
43
- },
44
- "950": {
45
- "value": "#031326",
46
- "type": "color"
47
- }
48
- },
49
- "purple": {
50
- "50": {
51
- "value": "#F8F1F9",
52
- "type": "color"
53
- },
54
- "100": {
55
- "value": "#F0DEF2",
56
- "type": "color"
57
- },
58
- "200": {
59
- "value": "#DDAFE4",
60
- "type": "color"
61
- },
62
- "300": {
63
- "value": "#CE81DA",
64
- "type": "color"
65
- },
66
- "400": {
67
- "value": "#c151d2",
68
- "type": "color"
69
- },
70
- "500": {
71
- "value": "#ac28c1",
72
- "type": "color"
73
- },
74
- "600": {
75
- "value": "#872796",
76
- "type": "color"
77
- },
78
- "700": {
79
- "value": "#682172",
80
- "type": "color"
81
- },
82
- "800": {
83
- "value": "#491b50",
84
- "type": "color"
85
- },
86
- "900": {
87
- "value": "#29112c",
88
- "type": "color"
89
- },
90
- "950": {
91
- "value": "#1a0d1c",
92
- "type": "color"
93
- }
94
- },
95
- "grey": {
96
- "50": {
97
- "value": "#f9fafb",
98
- "type": "color"
99
- },
100
- "100": {
101
- "value": "#eaedf0",
102
- "type": "color"
103
- },
104
- "200": {
105
- "value": "#cad0d8",
106
- "type": "color"
107
- },
108
- "300": {
109
- "value": "#aab4c0",
110
- "type": "color"
111
- },
112
- "400": {
113
- "value": "#8c98a6",
114
- "type": "color"
115
- },
116
- "500": {
117
- "value": "#6f7b8a",
118
- "type": "color"
119
- },
120
- "600": {
121
- "value": "#596573",
122
- "type": "color"
123
- },
124
- "700": {
125
- "value": "#434e5b",
126
- "type": "color"
127
- },
128
- "800": {
129
- "value": "#2f3741",
130
- "type": "color"
131
- },
132
- "900": {
133
- "value": "#1b2127",
134
- "type": "color"
135
- },
136
- "950": {
137
- "value": "#101418",
138
- "type": "color"
139
- }
140
- }
141
- }
142
- }
@@ -1,38 +0,0 @@
1
- /**
2
- * Do not edit directly
3
- * Generated on Sun, 04 Jun 2023 10:14:22 GMT
4
- */
5
-
6
- export const colorBlue50: string;
7
- export const colorBlue100: string;
8
- export const colorBlue200: string;
9
- export const colorBlue300: string;
10
- export const colorBlue400: string;
11
- export const colorBlue500: string;
12
- export const colorBlue600: string;
13
- export const colorBlue700: string;
14
- export const colorBlue800: string;
15
- export const colorBlue900: string;
16
- export const colorBlue950: string;
17
- export const colorPurple50: string;
18
- export const colorPurple100: string;
19
- export const colorPurple200: string;
20
- export const colorPurple300: string;
21
- export const colorPurple400: string;
22
- export const colorPurple500: string;
23
- export const colorPurple600: string;
24
- export const colorPurple700: string;
25
- export const colorPurple800: string;
26
- export const colorPurple900: string;
27
- export const colorPurple950: string;
28
- export const colorGrey50: string;
29
- export const colorGrey100: string;
30
- export const colorGrey200: string;
31
- export const colorGrey300: string;
32
- export const colorGrey400: string;
33
- export const colorGrey500: string;
34
- export const colorGrey600: string;
35
- export const colorGrey700: string;
36
- export const colorGrey800: string;
37
- export const colorGrey900: string;
38
- export const colorGrey950: string;