@centreon/ui 23.10.32 → 23.10.33
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 +12 -2
- 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 +389 -215
- package/src/api/TestQueryProvider.tsx +2 -1
- package/src/api/useFetchQuery/index.ts +8 -7
- package/src/api/useMutationQuery/index.ts +11 -10
- package/src/base/tokens/README.md +3 -0
- package/src/base/tokens/source/$metadata.json +5 -0
- package/src/base/tokens/source/base.json +142 -0
- package/src/base/tokens/themes/base.tokens.d.ts +38 -0
- package/src/base/tokens/themes/base.tokens.json +695 -0
- package/src/base/tokens/themes/base.tokens.ts +38 -0
- package/src/base/tokens/themes/ui-dark.tokens.d.ts +38 -0
- package/src/base/tokens/themes/ui-dark.tokens.json +695 -0
- package/src/base/tokens/themes/ui-dark.tokens.ts +38 -0
- package/src/base/tokens/themes/ui-light.tokens.d.ts +38 -0
- package/src/base/tokens/themes/ui-light.tokens.json +695 -0
- package/src/base/tokens/themes/ui-light.tokens.ts +38 -0
- package/src/components/Button/Button.styles.ts +17 -3
- package/src/components/Button/Button.tsx +6 -3
- package/src/components/Button/Icon/IconButton.styles.ts +9 -2
- package/src/components/DataTable/DataTable.stories.tsx +9 -0
- package/src/components/DataTable/DataTable.styles.ts +5 -0
- package/src/components/DataTable/DataTable.tsx +8 -6
- package/src/components/DataTable/EmptyState/DataTableEmptyState.tsx +4 -1
- package/src/components/DataTable/Item/DataTableItem.styles.ts +5 -2
- package/src/components/DataTable/Item/DataTableItem.tsx +36 -18
- package/src/components/Header/Header.styles.ts +0 -27
- package/src/components/Header/PageHeader/PageHeader.stories.tsx +88 -0
- package/src/components/Header/PageHeader/PageHeader.styles.ts +99 -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 +47 -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 +40 -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/Button/MenuButton.stories.tsx +16 -0
- package/src/components/Menu/Button/MenuButton.styles.ts +27 -0
- package/src/components/Menu/Button/MenuButton.tsx +62 -0
- package/src/components/Menu/Button/index.ts +1 -0
- package/src/components/Menu/Menu.stories.tsx +71 -0
- package/src/components/Menu/Menu.styles.ts +70 -0
- package/src/components/Menu/Menu.tsx +25 -0
- package/src/components/Menu/MenuDivider.tsx +13 -0
- package/src/components/Menu/MenuItem.tsx +36 -0
- package/src/components/Menu/MenuItems.tsx +35 -0
- package/src/components/Menu/index.ts +12 -0
- package/src/components/Menu/useMenu.tsx +79 -0
- package/src/components/Modal/index.ts +2 -0
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.stories.tsx +70 -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 +3 -0
- package/src/index.ts +0 -2
- package/src/screens/dashboard/DashboardsDetail.stories.tsx +108 -0
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +110 -102
- package/src/styles/tokens/themes/_ui-dark.tokens.json +695 -0
- package/src/styles/tokens/themes/_ui-light.tokens.json +695 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/sanitizedHTML.ts +1 -1
- package/src/utils/useResizeObserver.ts +6 -0
- package/test/setupTests.js +1 -1
- 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
|
@@ -11,16 +11,11 @@ import {
|
|
|
11
11
|
DashboardForm,
|
|
12
12
|
DashboardFormProps,
|
|
13
13
|
DataTable,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
Modal,
|
|
15
|
+
PageHeader,
|
|
16
|
+
PageLayout
|
|
16
17
|
} from '../../components';
|
|
17
18
|
import { Default as DashboardFormDefaultStory } from '../../components/Form/Dashboard/DashboardForm.stories';
|
|
18
|
-
import {
|
|
19
|
-
TiledListingActions,
|
|
20
|
-
TiledListingContent,
|
|
21
|
-
TiledListingList,
|
|
22
|
-
TiledListingPage
|
|
23
|
-
} from '../../layout/TiledListingPage';
|
|
24
19
|
|
|
25
20
|
const meta: Meta = {
|
|
26
21
|
args: {
|
|
@@ -64,7 +59,10 @@ const meta: Meta = {
|
|
|
64
59
|
},
|
|
65
60
|
title: 'Dashboards overview'
|
|
66
61
|
},
|
|
67
|
-
|
|
62
|
+
parameters: {
|
|
63
|
+
layout: 'fullscreen'
|
|
64
|
+
},
|
|
65
|
+
title: 'screens/Dashboards overview'
|
|
68
66
|
};
|
|
69
67
|
|
|
70
68
|
export default meta;
|
|
@@ -134,10 +132,16 @@ const DefaultView = (args): JSX.Element => {
|
|
|
134
132
|
};
|
|
135
133
|
|
|
136
134
|
return (
|
|
137
|
-
<
|
|
138
|
-
<Header
|
|
139
|
-
|
|
140
|
-
|
|
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>
|
|
141
145
|
{dataDashboards.length !== 0 && (
|
|
142
146
|
<Button
|
|
143
147
|
aria-label="add"
|
|
@@ -150,101 +154,105 @@ const DefaultView = (args): JSX.Element => {
|
|
|
150
154
|
{actions.create.label}
|
|
151
155
|
</Button>
|
|
152
156
|
)}
|
|
153
|
-
</
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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={() =>
|
|
157
|
+
</PageLayout.Actions>
|
|
158
|
+
|
|
159
|
+
<DataTable isEmpty={dataDashboards.length === 0}>
|
|
160
|
+
{dataDashboards.length === 0 ? (
|
|
161
|
+
<DataTable.EmptyState
|
|
162
|
+
labels={list.emptyState.labels}
|
|
163
|
+
onCreate={() =>
|
|
205
164
|
setDialogState({
|
|
206
165
|
item: null,
|
|
207
|
-
open:
|
|
208
|
-
variant:
|
|
166
|
+
open: true,
|
|
167
|
+
variant: 'create'
|
|
209
168
|
})
|
|
210
169
|
}
|
|
211
|
-
onSubmit={(values) =>
|
|
212
|
-
dialogState.variant === 'create'
|
|
213
|
-
? createDashboard(values)
|
|
214
|
-
: updateDashboard(values)
|
|
215
|
-
}
|
|
216
170
|
/>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
+
}
|
|
244
225
|
/>
|
|
245
|
-
</Modal>
|
|
246
|
-
</
|
|
247
|
-
|
|
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>
|
|
248
256
|
);
|
|
249
257
|
};
|
|
250
258
|
|