@centreon/ui 25.5.8 → 25.6.1
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 +15 -6
- package/src/Dashboard/Dashboard.styles.ts +1 -1
- package/src/Dashboard/Layout.tsx +1 -1
- package/src/Graph/BarChart/BarChart.cypress.spec.tsx +0 -2
- package/src/Listing/ActionBar/Pagination.tsx +10 -23
- package/src/Listing/ActionBar/PaginationActions.tsx +1 -10
- package/src/Listing/Cell/DataCell.tsx +6 -6
- package/src/Listing/Cell/EllipsisTypography.tsx +10 -32
- package/src/Listing/Cell/index.tsx +37 -76
- package/src/Listing/Checkbox.tsx +8 -20
- package/src/Listing/Header/Cell/ListingHeaderCell.tsx +17 -14
- package/src/Listing/Header/Cell/SelectActionListingHeaderCell.tsx +5 -9
- package/src/Listing/Header/ListingHeader.tsx +2 -5
- package/src/Listing/Header/_internals/Label.tsx +1 -17
- package/src/Listing/Row/EmptyRow.tsx +2 -6
- package/src/Listing/Row/Row.tsx +7 -36
- package/src/Listing/index.stories.tsx +1 -0
- package/src/Listing/index.tsx +20 -22
- package/src/StoryBookThemeProvider/index.tsx +3 -1
- package/src/ThemeProvider/index.tsx +3 -1
- package/src/ThemeProvider/tailwindcss.css +202 -0
- package/src/components/Avatar/Avatar.stories.tsx +1 -0
- package/src/components/Button/Button.module.css +38 -0
- package/src/components/Button/Button.stories.tsx +25 -0
- package/src/components/Button/Button.tsx +2 -5
- package/src/components/CrudPage/CrudPageRoot.tsx +1 -1
- package/src/components/DataTable/EmptyState/DataTableEmptyState.tsx +4 -1
- package/src/components/Layout/AreaIndicator.tsx +4 -6
- package/src/Listing/Cell/DataCell.styles.ts +0 -27
- package/src/Listing/Header/Cell/ListingHeaderCell.styles.ts +0 -71
- package/src/Listing/Header/Cell/SelectActionListingHeaderCell.styles.ts +0 -26
- package/src/Listing/Header/ListingHeader.styles.ts +0 -16
- package/src/Listing/Listing.styles.ts +0 -78
- package/src/Listing/Row/EmptyRow.styles.ts +0 -14
- package/src/components/Button/Button.styles.ts +0 -44
- package/src/components/Layout/AreaIndicator.styles.ts +0 -33
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import { makeStyles } from 'tss-react/mui';
|
|
2
|
-
|
|
3
1
|
import { Typography, TypographyProps } from '@mui/material';
|
|
4
2
|
import { ReactNode } from 'react';
|
|
5
3
|
|
|
6
|
-
const useStyles = makeStyles()(() => ({
|
|
7
|
-
root: {
|
|
8
|
-
fontWeight: 'bold'
|
|
9
|
-
}
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
4
|
interface Props {
|
|
13
5
|
children: ReactNode;
|
|
14
6
|
}
|
|
@@ -17,16 +9,8 @@ const HeaderLabel = ({
|
|
|
17
9
|
children,
|
|
18
10
|
className
|
|
19
11
|
}: Props & Pick<TypographyProps, 'className'>): JSX.Element => {
|
|
20
|
-
const { classes } = useStyles();
|
|
21
|
-
|
|
22
12
|
return (
|
|
23
|
-
<Typography
|
|
24
|
-
className={className}
|
|
25
|
-
classes={{
|
|
26
|
-
root: classes.root
|
|
27
|
-
}}
|
|
28
|
-
variant="body2"
|
|
29
|
-
>
|
|
13
|
+
<Typography className={`font-bold ${className}`} variant="body2">
|
|
30
14
|
{children}
|
|
31
15
|
</Typography>
|
|
32
16
|
);
|
|
@@ -4,20 +4,16 @@ import { TableRow } from '@mui/material';
|
|
|
4
4
|
|
|
5
5
|
import Cell from '../Cell';
|
|
6
6
|
|
|
7
|
-
import { useStyles } from './EmptyRow.styles';
|
|
8
|
-
|
|
9
7
|
interface EmptyRowProps {
|
|
10
8
|
children: ReactNode;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
const EmptyRow = ({ children }: EmptyRowProps): JSX.Element => {
|
|
14
|
-
const { classes } = useStyles();
|
|
15
|
-
|
|
16
12
|
return (
|
|
17
|
-
<TableRow className=
|
|
13
|
+
<TableRow className="contents" component="div" tabIndex={-1}>
|
|
18
14
|
<Cell
|
|
19
15
|
align="center"
|
|
20
|
-
className=
|
|
16
|
+
className="col-span-full flex justify-center"
|
|
21
17
|
disableRowCondition={(): boolean => false}
|
|
22
18
|
isRowHovered={false}
|
|
23
19
|
>
|
package/src/Listing/Row/Row.tsx
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { memo, useEffect, useRef } from 'react';
|
|
4
4
|
|
|
5
5
|
import { equals, gte, lt, not, pluck } from 'ramda';
|
|
6
|
-
import { makeStyles } from 'tss-react/mui';
|
|
7
6
|
|
|
8
7
|
import { TableRow, TableRowProps, useTheme } from '@mui/material';
|
|
9
8
|
|
|
@@ -14,27 +13,6 @@ import { useViewportIntersection } from '../../utils/useViewportIntersection';
|
|
|
14
13
|
import { performanceRowsLimit } from '../index';
|
|
15
14
|
import { Column, ColumnConfiguration, RowColorCondition } from '../models';
|
|
16
15
|
|
|
17
|
-
const useStyles = makeStyles()((theme) => {
|
|
18
|
-
return {
|
|
19
|
-
intersectionRow: {
|
|
20
|
-
display: 'contents',
|
|
21
|
-
width: '100%'
|
|
22
|
-
},
|
|
23
|
-
row: {
|
|
24
|
-
cursor: 'pointer',
|
|
25
|
-
display: 'contents',
|
|
26
|
-
width: '100%'
|
|
27
|
-
},
|
|
28
|
-
skeleton: {
|
|
29
|
-
height: theme.spacing(2.5),
|
|
30
|
-
width: '100%'
|
|
31
|
-
},
|
|
32
|
-
skeletonContainer: {
|
|
33
|
-
padding: theme.spacing(0.5)
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
|
|
38
16
|
type Props = {
|
|
39
17
|
checkable: boolean;
|
|
40
18
|
children;
|
|
@@ -70,22 +48,20 @@ const Row = memo<RowProps>(
|
|
|
70
48
|
checkable,
|
|
71
49
|
limit
|
|
72
50
|
}: RowProps): JSX.Element => {
|
|
73
|
-
const { classes } = useStyles();
|
|
74
|
-
|
|
75
51
|
if (not(isInViewport) && gte(limit, performanceRowsLimit)) {
|
|
76
52
|
return (
|
|
77
|
-
<div
|
|
53
|
+
<div className="contents">
|
|
78
54
|
{checkable && (
|
|
79
|
-
<div className=
|
|
55
|
+
<div className="p-1">
|
|
80
56
|
<div>
|
|
81
|
-
<LoadingSkeleton className=
|
|
57
|
+
<LoadingSkeleton className="w-full" />
|
|
82
58
|
</div>
|
|
83
59
|
</div>
|
|
84
60
|
)}
|
|
85
61
|
{visibleColumns.map(({ id }) => (
|
|
86
|
-
<div className=
|
|
62
|
+
<div className="p-1" key={`loading_${id}`}>
|
|
87
63
|
<div>
|
|
88
|
-
<LoadingSkeleton className=
|
|
64
|
+
<LoadingSkeleton className="w-full" />
|
|
89
65
|
</div>
|
|
90
66
|
</div>
|
|
91
67
|
))}
|
|
@@ -95,7 +71,7 @@ const Row = memo<RowProps>(
|
|
|
95
71
|
|
|
96
72
|
return (
|
|
97
73
|
<TableRow
|
|
98
|
-
className=
|
|
74
|
+
className="cursor-pointer contents w-full"
|
|
99
75
|
component="div"
|
|
100
76
|
tabIndex={tabIndex}
|
|
101
77
|
onClick={onClick}
|
|
@@ -203,7 +179,6 @@ const IntersectionRow = ({ isHovered, ...rest }: Props): JSX.Element => {
|
|
|
203
179
|
root: rowRef.current?.parentElement?.parentElement?.parentElement,
|
|
204
180
|
rootMargin: `${theme.spacing(20)} 0px ${theme.spacing(20)} 0px`
|
|
205
181
|
});
|
|
206
|
-
const { classes } = useStyles();
|
|
207
182
|
|
|
208
183
|
const getFirstCellElement = (): ChildNode | null | undefined =>
|
|
209
184
|
rowRef.current?.firstChild?.firstChild?.firstChild;
|
|
@@ -213,11 +188,7 @@ const IntersectionRow = ({ isHovered, ...rest }: Props): JSX.Element => {
|
|
|
213
188
|
}, [getFirstCellElement()]);
|
|
214
189
|
|
|
215
190
|
return (
|
|
216
|
-
<div
|
|
217
|
-
className={classes.intersectionRow}
|
|
218
|
-
data-is-hovered={isHovered}
|
|
219
|
-
ref={rowRef}
|
|
220
|
-
>
|
|
191
|
+
<div className="contents w-full" data-is-hovered={isHovered} ref={rowRef}>
|
|
221
192
|
<Row {...rest} isHovered={isHovered} isInViewport={isInViewport} />
|
|
222
193
|
</div>
|
|
223
194
|
);
|
package/src/Listing/index.tsx
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable react/no-array-index-key */
|
|
2
|
-
|
|
3
1
|
import { useAtomValue } from 'jotai';
|
|
4
2
|
import {
|
|
5
3
|
concat,
|
|
@@ -49,7 +47,6 @@ import DataCell from './Cell/DataCell';
|
|
|
49
47
|
import Checkbox from './Checkbox';
|
|
50
48
|
import { EmptyResult } from './EmptyResult/EmptyResult';
|
|
51
49
|
import { ListingHeader } from './Header';
|
|
52
|
-
import { useListingStyles } from './Listing.styles';
|
|
53
50
|
import ListingRow from './Row/Row';
|
|
54
51
|
import { SkeletonLoader } from './Row/SkeletonLoaderRows';
|
|
55
52
|
import {
|
|
@@ -290,14 +287,6 @@ const Listing = <
|
|
|
290
287
|
},
|
|
291
288
|
[allSubItemIds]
|
|
292
289
|
);
|
|
293
|
-
|
|
294
|
-
const { classes } = useListingStyles({
|
|
295
|
-
dataStyle,
|
|
296
|
-
gridTemplateColumn,
|
|
297
|
-
isResponsive,
|
|
298
|
-
rows: rowsToDisplay
|
|
299
|
-
});
|
|
300
|
-
|
|
301
290
|
const { isShiftKeyDown } = useKeyObserver();
|
|
302
291
|
|
|
303
292
|
const haveSameId = (row: TRow, rowToCompare: TRow): boolean =>
|
|
@@ -519,20 +508,20 @@ const Listing = <
|
|
|
519
508
|
const areColumnsEditable = not(isNil(onSelectColumns));
|
|
520
509
|
|
|
521
510
|
return (
|
|
522
|
-
<div className=
|
|
511
|
+
<div className="h-full w-full overflow-hidden">
|
|
523
512
|
{loading && rows.length > 0 && (
|
|
524
|
-
<LinearProgress className=
|
|
513
|
+
<LinearProgress className="w-full h-[3px]" />
|
|
525
514
|
)}
|
|
526
515
|
{(!loading || (loading && rows.length < 1)) && (
|
|
527
|
-
<div className=
|
|
516
|
+
<div className="w-full h-[3px]" />
|
|
528
517
|
)}
|
|
529
518
|
<div
|
|
530
|
-
className=
|
|
519
|
+
className="bg-[none] flex-column h-full w-full"
|
|
531
520
|
ref={containerRef as RefObject<HTMLDivElement>}
|
|
532
521
|
>
|
|
533
522
|
{isActionBarVisible && (
|
|
534
523
|
<div
|
|
535
|
-
className=
|
|
524
|
+
className="flex items-center"
|
|
536
525
|
ref={actionBarRef as RefObject<HTMLDivElement>}
|
|
537
526
|
>
|
|
538
527
|
<ListingActionBar
|
|
@@ -566,7 +555,7 @@ const Listing = <
|
|
|
566
555
|
>
|
|
567
556
|
{({ height }) => (
|
|
568
557
|
<Box
|
|
569
|
-
className=
|
|
558
|
+
className="border-b-[none] overflow-auto"
|
|
570
559
|
component="div"
|
|
571
560
|
style={{
|
|
572
561
|
height: innerScrollDisabled ? '100%' : `calc(${height}px - 4px)`
|
|
@@ -577,7 +566,13 @@ const Listing = <
|
|
|
577
566
|
) : (
|
|
578
567
|
<Table
|
|
579
568
|
stickyHeader
|
|
580
|
-
className=
|
|
569
|
+
className="grid items-center relative"
|
|
570
|
+
style={{
|
|
571
|
+
gridTemplateColumns: gridTemplateColumn,
|
|
572
|
+
gridTemplateRows: `${dataStyle.header.height}px repeat(${
|
|
573
|
+
rowsToDisplay.length || 1
|
|
574
|
+
}, ${isResponsive ? 'auto' : `${dataStyle.body.height}px`})`
|
|
575
|
+
}}
|
|
581
576
|
component="div"
|
|
582
577
|
size="small"
|
|
583
578
|
>
|
|
@@ -600,7 +595,7 @@ const Listing = <
|
|
|
600
595
|
/>
|
|
601
596
|
|
|
602
597
|
<TableBody
|
|
603
|
-
className=
|
|
598
|
+
className="contents relative"
|
|
604
599
|
component="div"
|
|
605
600
|
onMouseLeave={clearHoveredRow}
|
|
606
601
|
>
|
|
@@ -651,7 +646,7 @@ const Listing = <
|
|
|
651
646
|
(!isSubItem || subItems.canCheckSubItems ? (
|
|
652
647
|
<Cell
|
|
653
648
|
align="left"
|
|
654
|
-
className=
|
|
649
|
+
className="justify-start"
|
|
655
650
|
disableRowCondition={disableRowCondition}
|
|
656
651
|
isRowHovered={isRowHovered}
|
|
657
652
|
row={row}
|
|
@@ -664,9 +659,12 @@ const Listing = <
|
|
|
664
659
|
disableRowCheckCondition(row) ||
|
|
665
660
|
disableRowCondition(row)
|
|
666
661
|
}
|
|
667
|
-
|
|
668
|
-
|
|
662
|
+
slotProps={{
|
|
663
|
+
input: {
|
|
664
|
+
'aria-label': `Select row ${getId(row)}`
|
|
665
|
+
}
|
|
669
666
|
}}
|
|
667
|
+
className="pl-1"
|
|
670
668
|
/>
|
|
671
669
|
</Cell>
|
|
672
670
|
) : (
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
import { ThemeMode } from '@centreon/ui-context';
|
|
11
11
|
|
|
12
|
+
import { GlobalStyles } from '@mui/system';
|
|
12
13
|
import { getTheme } from '../ThemeProvider';
|
|
13
14
|
|
|
14
15
|
interface Props {
|
|
@@ -23,7 +24,8 @@ const StoryBookThemeProvider = ({
|
|
|
23
24
|
const theme = useMemo(() => createTheme(getTheme(themeMode)), [themeMode]);
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
|
-
<StyledEngineProvider injectFirst>
|
|
27
|
+
<StyledEngineProvider injectFirst enableCssLayer>
|
|
28
|
+
<GlobalStyles styles="@layer theme,base,mui,components,utilities;" />
|
|
27
29
|
<MuiThemeProvider theme={theme}>
|
|
28
30
|
{children}
|
|
29
31
|
<CssBaseline />
|
|
@@ -21,6 +21,7 @@ import RobotoLightWoff2 from '../fonts/roboto-light-webfont.woff2';
|
|
|
21
21
|
import RobotoMediumWoff2 from '../fonts/roboto-medium-webfont.woff2';
|
|
22
22
|
import RobotoRegularWoff2 from '../fonts/roboto-regular-webfont.woff2';
|
|
23
23
|
|
|
24
|
+
import { GlobalStyles } from '@mui/system';
|
|
24
25
|
import { ReactNode, useMemo } from 'react';
|
|
25
26
|
import { getPalette } from './palettes';
|
|
26
27
|
|
|
@@ -304,7 +305,8 @@ const ThemeProvider = ({ children }: Props): JSX.Element => {
|
|
|
304
305
|
);
|
|
305
306
|
|
|
306
307
|
return (
|
|
307
|
-
<StyledEngineProvider injectFirst>
|
|
308
|
+
<StyledEngineProvider injectFirst enableCssLayer>
|
|
309
|
+
<GlobalStyles styles="@layer theme,base,mui,components,utilities;" />
|
|
308
310
|
<MuiThemeProvider theme={theme}>
|
|
309
311
|
<CssBaseline />
|
|
310
312
|
{children}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
4
|
+
|
|
5
|
+
@theme {
|
|
6
|
+
--font-body: Roboto, Arial, serif;
|
|
7
|
+
|
|
8
|
+
--spacing: 4px;
|
|
9
|
+
|
|
10
|
+
--spacing-0: calc(var(--spacing) * 0);
|
|
11
|
+
--spacing-1: calc(var(--spacing) * 1);
|
|
12
|
+
--spacing-2: calc(var(--spacing) * 2);
|
|
13
|
+
--spacing-3: calc(var(--spacing) * 3);
|
|
14
|
+
--spacing-4: calc(var(--spacing) * 4);
|
|
15
|
+
--spacing-5: calc(var(--spacing) * 5);
|
|
16
|
+
--spacing-6: calc(var(--spacing) * 6);
|
|
17
|
+
--spacing-7: calc(var(--spacing) * 7);
|
|
18
|
+
--spacing-8: calc(var(--spacing) * 8);
|
|
19
|
+
--spacing-9: calc(var(--spacing) * 9);
|
|
20
|
+
--spacing-10: calc(var(--spacing) * 10);
|
|
21
|
+
|
|
22
|
+
--color-action-acknowledged: #745f35;
|
|
23
|
+
--color-action-acknowledged-background: #dfd2b9;
|
|
24
|
+
--color-action-in-flapping: #064a3f;
|
|
25
|
+
--color-action-in-flapping-background: #d8f3ef;
|
|
26
|
+
--color-action-activated-opacity: 0.12;
|
|
27
|
+
--color-action-active: #666666;
|
|
28
|
+
--color-action-disabled: #999999;
|
|
29
|
+
--color-action-disabled-background: rgba(0, 0, 0, 0.12);
|
|
30
|
+
--color-action-focus: #dadada;
|
|
31
|
+
--color-action-focus-opacity: 0.12;
|
|
32
|
+
--color-action-hover: rgba(0, 0, 0, 0.06);
|
|
33
|
+
--color-action-hover-opacity: 0.06;
|
|
34
|
+
--color-action-in-downtime: #512980;
|
|
35
|
+
--color-action-in-downtime-background: #e5d8f3;
|
|
36
|
+
--color-action-selected: rgba(102, 102, 102, 0.3);
|
|
37
|
+
--color-action-selected-opacity: 0.3;
|
|
38
|
+
--color-background-default: #f4f4f4;
|
|
39
|
+
--color-background-listing-header: #666666;
|
|
40
|
+
--color-background-panel: #ededed;
|
|
41
|
+
--color-background-panel-groups: #f5f5f5;
|
|
42
|
+
--color-background-paper: #ffffff;
|
|
43
|
+
--color-background-tooltip: #434e58;
|
|
44
|
+
--color-background-widget: #f8f8f8;
|
|
45
|
+
--color-chip-error: #ff6666;
|
|
46
|
+
--color-chip-info: #1588d1;
|
|
47
|
+
--color-chip-neutral: #6da4e4;
|
|
48
|
+
--color-chip-success: #88b922;
|
|
49
|
+
--color-chip-warning: #fd9b27;
|
|
50
|
+
--color-divider: #e3e3e3;
|
|
51
|
+
--color-error-main: #ff4a4a;
|
|
52
|
+
--color-header-page-action-background-active: #1975d10f;
|
|
53
|
+
--color-header-page-action-background-default: #ffffff00;
|
|
54
|
+
--color-header-page-action-color-active: #1976d2;
|
|
55
|
+
--color-header-page-action-color-default: #696969;
|
|
56
|
+
--color-header-page-border: #ededed;
|
|
57
|
+
--color-header-page-description: #4a4a4a;
|
|
58
|
+
--color-header-page-title: #000000;
|
|
59
|
+
--color-header-info-main: #1588d1;
|
|
60
|
+
--color-header-layout-body-background: #f6f6f6;
|
|
61
|
+
--color-header-layout-header-background: #ffffff;
|
|
62
|
+
--color-header-layout-header-border: #e3e3e3;
|
|
63
|
+
--color-header-menu-background: #ffffff;
|
|
64
|
+
--color-header-menu-button-background-active: #ecf4fd;
|
|
65
|
+
--color-header-menu-button-background-default: transparent;
|
|
66
|
+
--color-header-menu-button-background-hover: #d2e4f9;
|
|
67
|
+
--color-header-menu-button-color-active: #3e85d5;
|
|
68
|
+
--color-header-menu-button-color-default: #8c98a6;
|
|
69
|
+
--color-header-menu-button-color-hover: #6f7b8a;
|
|
70
|
+
--color-header-menu-divider-border: #cad0d8;
|
|
71
|
+
--color-header-menu-item-background-active: #ecf4fd;
|
|
72
|
+
--color-header-menu-item-background-default: transparent;
|
|
73
|
+
--color-header-menu-item-background-hover: #eaedf0;
|
|
74
|
+
--color-header-menu-item-color-active: #3e85d5;
|
|
75
|
+
--color-header-menu-item-color-default: #1b2127;
|
|
76
|
+
--color-header-menu-item-color-hover: #101418;
|
|
77
|
+
--color-pending-main: #1ebeb3;
|
|
78
|
+
--color-primary-main: #2e68aa;
|
|
79
|
+
--color-primary-light: #cde7fc;
|
|
80
|
+
--color-primary-dark: #255891;
|
|
81
|
+
--color-secondary-main: #c772d6;
|
|
82
|
+
--color-secondary-light: #e5a5f0;
|
|
83
|
+
--color-secondary-dark: #ac28c1;
|
|
84
|
+
--color-status-background-error: #ff6666;
|
|
85
|
+
--color-status-background-none: --alpha(#2e68aa / 10%);
|
|
86
|
+
--color-status-background-pending: #1ebeb3;
|
|
87
|
+
--color-status-background-success: #88b922;
|
|
88
|
+
--color-stauts-background-unknown: #e3e3e3;
|
|
89
|
+
--color-status-background-warning: #fd9b27;
|
|
90
|
+
--color-success-main: #88b922;
|
|
91
|
+
--color-text-disabled: #999999;
|
|
92
|
+
--color-text-primary: #000000;
|
|
93
|
+
--color-text-secondary: #666666;
|
|
94
|
+
--color-warning-main: #fd9b27;
|
|
95
|
+
--color-white: #ffffff;
|
|
96
|
+
--color-black: #000000;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@layer base {
|
|
100
|
+
@variant dark {
|
|
101
|
+
--color-action-acknowledged: #dfd2b9;
|
|
102
|
+
--color-action-acknowledged-background: #745f35;
|
|
103
|
+
--color-action-in-flapping: #d8f3ef;
|
|
104
|
+
--color-action-in-flapping-background: #064a3f;
|
|
105
|
+
--color-action-activated-opacity: 0.3;
|
|
106
|
+
--color-action-active: #b5b5b5;
|
|
107
|
+
--color-action-disabled: #999999;
|
|
108
|
+
--color-action-disabled-background: rgba(0, 0, 0, 0.12);
|
|
109
|
+
--color-action-focus: #6d6d6d;
|
|
110
|
+
--color-action-focus-opacity: 0.3;
|
|
111
|
+
--color-action-hover: rgba(255, 255, 255, 0.16);
|
|
112
|
+
--color-action-hover-opacity: 0.16;
|
|
113
|
+
--color-action-in-downtime: #e5d8f3;
|
|
114
|
+
--color-action-in-downtime-background: #512980;
|
|
115
|
+
--color-action-selected: rgba(255, 255, 255, 0.5);
|
|
116
|
+
--color-action-selected-opacity: 0.5;
|
|
117
|
+
--color-background-default: #4a4a4a;
|
|
118
|
+
--color-background-listing-header: #666666;
|
|
119
|
+
--color-background-panel: #4a4a4a;
|
|
120
|
+
--color-background-panel-groups: #252525;
|
|
121
|
+
--color-background-paper: #212121;
|
|
122
|
+
--color-background-tooltip: #aab4c0;
|
|
123
|
+
--color-background-widget: #2e2e2e;
|
|
124
|
+
--color-chip-error: #d60101;
|
|
125
|
+
--color-chip-info: #1ca9f4;
|
|
126
|
+
--color-chip-neutral: #434e5b;
|
|
127
|
+
--color-chip-success: #5f8118;
|
|
128
|
+
--color-chip-warning: #c55400;
|
|
129
|
+
--color-divider: #666666;
|
|
130
|
+
--color-error-main: #d60101;
|
|
131
|
+
--color-header-page-action-background-active: #1975d10f;
|
|
132
|
+
--color-header-page-action-background-default: #ffffff00;
|
|
133
|
+
--color-header-page-action-color-active: #1976d2;
|
|
134
|
+
--color-header-page-action-color-default: #696969;
|
|
135
|
+
--color-header-page-border: #666666;
|
|
136
|
+
--color-header-page-description: #bdbdbd;
|
|
137
|
+
--color-header-page-title: #ffffff;
|
|
138
|
+
--color-header-info-main: #1ca9f4;
|
|
139
|
+
--color-header-layout-body-background: #f6f6f6;
|
|
140
|
+
--color-header-layout-header-background: #ffffff;
|
|
141
|
+
--color-header-layout-header-border: #e3e3e3;
|
|
142
|
+
--color-header-menu-background: #101418;
|
|
143
|
+
--color-header-menu-button-background-active: #071d37;
|
|
144
|
+
--color-header-menu-button-background-default: transparent;
|
|
145
|
+
--color-header-menu-button-background-hover: #1b2127;
|
|
146
|
+
--color-header-menu-button-color-active: #205593;
|
|
147
|
+
--color-header-menu-button-color-default: #596573;
|
|
148
|
+
--color-header-menu-button-color-hover: #6f7b8a;
|
|
149
|
+
--color-header-menu-divider-border: #2f3741;
|
|
150
|
+
--color-header-menu-item-background-active: #071d37;
|
|
151
|
+
--color-header-menu-item-background-default: transparent;
|
|
152
|
+
--color-header-menu-item-background-hover: #1b2127;
|
|
153
|
+
--color-header-menu-item-color-active: #3e85d5;
|
|
154
|
+
--color-header-menu-item-color-default: #f9fafb;
|
|
155
|
+
--color-header-menu-item-color-hover: #ffffff;
|
|
156
|
+
--color-pending-main: #118077;
|
|
157
|
+
--color-primary-main: #6eaff8;
|
|
158
|
+
--color-primary-light: #8bbff9;
|
|
159
|
+
--color-primary-dark: #4974a5;
|
|
160
|
+
--color-secondary-main: #7c1fa2;
|
|
161
|
+
--color-status-background-error: #d60101;
|
|
162
|
+
--color-status-background-none: --alpha(#2e68aa / 10%);
|
|
163
|
+
--color-status-background-pending: #118077;
|
|
164
|
+
--color-status-background-success: #5f8118;
|
|
165
|
+
--color-stauts-background-unknown: #666666;
|
|
166
|
+
--color-status-background-warning: #c55400;
|
|
167
|
+
--color-success-main: #5f8118;
|
|
168
|
+
--color-text-disabled: #666666;
|
|
169
|
+
--color-text-primary: #ffffff;
|
|
170
|
+
--color-text-secondary: #cccccc;
|
|
171
|
+
--color-warning-main: #c55400;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@layer components {
|
|
176
|
+
.flex-column {
|
|
177
|
+
@apply flex flex-col gap-1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.flex-row {
|
|
181
|
+
@apply flex flex-row gap-1;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.flex-column-center {
|
|
185
|
+
@apply flex flex-col items-center;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.flex-column-start {
|
|
189
|
+
@apply flex flex-col items-start;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.flex-column-end {
|
|
193
|
+
@apply flex flex-col items-end;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
#root {
|
|
198
|
+
transition-duration: var(--default-transition-duration);
|
|
199
|
+
transition-property:
|
|
200
|
+
color, background-color, border-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter;
|
|
201
|
+
transition-timing-function: var(--default-transition-timing-function);
|
|
202
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.button {
|
|
2
|
+
&[data-size="medium"] {
|
|
3
|
+
font-size: 16px;
|
|
4
|
+
height: unset;
|
|
5
|
+
line-height: 24px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&[data-size="small"] {
|
|
9
|
+
&[data-variant="primary"] {
|
|
10
|
+
padding-left: var(--spacing-4);
|
|
11
|
+
padding-right: var(--spacing-4);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
height: unset;
|
|
16
|
+
line-height: 22px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&[data-variant="primary"]:not(:disabled) {
|
|
20
|
+
&[data-is-danger="true"] {
|
|
21
|
+
background-color: var(--color-error-main);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
background-color: var(--color-primary-main);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&[data-variant="secondary"]:not(:disabled) {
|
|
28
|
+
&[data-is-danger="true"] {
|
|
29
|
+
border-color: var(--color-error-main);
|
|
30
|
+
color: var(--color-error-main);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
border-color: var(--color-primary-main);
|
|
34
|
+
color: var(--color-primary-main);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
text-wrap: nowrap;
|
|
38
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '../../ThemeProvider/tailwindcss.css';
|
|
1
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
|
|
3
4
|
import { Add as AddIcon } from '@mui/icons-material';
|
|
@@ -32,3 +33,27 @@ export const AsDanger: Story = {
|
|
|
32
33
|
isDanger: true
|
|
33
34
|
}
|
|
34
35
|
};
|
|
36
|
+
|
|
37
|
+
export const small: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
...Default.args,
|
|
40
|
+
size: 'small'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const smallWithIcon: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
...Default.args,
|
|
47
|
+
size: 'small',
|
|
48
|
+
icon: <AddIcon />,
|
|
49
|
+
iconVariant: 'start'
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const smallDanger: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
...Default.args,
|
|
56
|
+
size: 'small',
|
|
57
|
+
isDanger: true
|
|
58
|
+
}
|
|
59
|
+
};
|
|
@@ -7,8 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import { AriaLabelingAttributes } from '../../@types/aria-attributes';
|
|
9
9
|
import { DataTestAttributes } from '../../@types/data-attributes';
|
|
10
|
-
|
|
11
|
-
import { useStyles } from './Button.styles';
|
|
10
|
+
import { button } from './Button.module.css';
|
|
12
11
|
|
|
13
12
|
const muiVariantMap: Record<
|
|
14
13
|
Required<ButtonProps>['variant'],
|
|
@@ -48,8 +47,6 @@ const Button = ({
|
|
|
48
47
|
className = '',
|
|
49
48
|
...attr
|
|
50
49
|
}: ButtonProps): ReactElement => {
|
|
51
|
-
const { classes, cx } = useStyles();
|
|
52
|
-
|
|
53
50
|
const MuiOverrideProps = useMemo(
|
|
54
51
|
() => ({
|
|
55
52
|
color: 'primary' as const,
|
|
@@ -61,7 +58,7 @@ const Button = ({
|
|
|
61
58
|
|
|
62
59
|
return (
|
|
63
60
|
<MuiButton
|
|
64
|
-
className={
|
|
61
|
+
className={`${button} ${className}`}
|
|
65
62
|
data-icon-variant={iconVariant}
|
|
66
63
|
data-is-danger={isDanger}
|
|
67
64
|
data-size={size}
|
|
@@ -97,7 +97,7 @@ export const CrudPageRoot = <
|
|
|
97
97
|
{isDataEmpty && !isLoading ? (
|
|
98
98
|
<DataTable.EmptyState
|
|
99
99
|
aria-label="create"
|
|
100
|
-
|
|
100
|
+
buttonCreateTestId="create-crudpage"
|
|
101
101
|
labels={{
|
|
102
102
|
title: labels.welcome.title,
|
|
103
103
|
description: labels.welcome.description,
|
|
@@ -19,12 +19,14 @@ type ListEmptyStateProps = {
|
|
|
19
19
|
description?: string;
|
|
20
20
|
};
|
|
21
21
|
onCreate?: () => void;
|
|
22
|
+
buttonCreateTestId?: string;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
const DataTableEmptyState = ({
|
|
25
26
|
labels,
|
|
26
27
|
onCreate,
|
|
27
|
-
canCreate = true
|
|
28
|
+
canCreate = true,
|
|
29
|
+
buttonCreateTestId
|
|
28
30
|
}: ListEmptyStateProps): ReactElement => {
|
|
29
31
|
const { classes } = useStyles();
|
|
30
32
|
const { t } = useTranslation();
|
|
@@ -47,6 +49,7 @@ const DataTableEmptyState = ({
|
|
|
47
49
|
icon={<AddIcon />}
|
|
48
50
|
iconVariant="start"
|
|
49
51
|
onClick={() => onCreate?.()}
|
|
52
|
+
data-testid={buttonCreateTestId}
|
|
50
53
|
>
|
|
51
54
|
{t(labels.actions?.create || '')}
|
|
52
55
|
</Button>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useStyles } from './AreaIndicator.styles';
|
|
4
|
-
|
|
5
3
|
type AreaIndicatorProps = {
|
|
6
4
|
children?: ReactNode | Array<ReactNode>;
|
|
7
5
|
depth?: number;
|
|
@@ -17,16 +15,16 @@ const AreaIndicator = ({
|
|
|
17
15
|
height = '100%',
|
|
18
16
|
depth = 0
|
|
19
17
|
}: AreaIndicatorProps): ReactElement => {
|
|
20
|
-
const { classes } = useStyles();
|
|
21
|
-
|
|
22
18
|
return (
|
|
23
19
|
<div
|
|
24
|
-
className={
|
|
20
|
+
className={'bg-secondary-main/25 relative min-h-8'}
|
|
25
21
|
data-depth={depth}
|
|
26
22
|
style={{ height, width }}
|
|
27
23
|
>
|
|
28
24
|
{/* biome-ignore lint/a11y: */}
|
|
29
|
-
<label>
|
|
25
|
+
<label className="left-2 rounded-sm border border-[#9747FF7F] border-dashed text-[#9747FF] text-[0.75rem] font-medium left-2 absolute top-1.5 px-2 py-0.5">
|
|
26
|
+
{name}
|
|
27
|
+
</label>
|
|
30
28
|
{children}
|
|
31
29
|
</div>
|
|
32
30
|
);
|