@groupeactual/ui-kit 1.5.2 → 1.6.0-beta.3
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/dist/cjs/index.js +16 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/DesignSystemProvider.d.ts +3 -3
- package/dist/cjs/types/components/Accordion/Accordion.d.ts +3 -1
- package/dist/cjs/types/components/Chip/Chip.d.ts +3 -3
- package/dist/cjs/types/components/Datatable/Datatable.d.ts +1 -1
- package/dist/cjs/types/components/Datatable/DatatableCellRender.d.ts +0 -1
- package/dist/cjs/types/components/Datatable/datatable.interface.d.ts +1 -1
- package/dist/cjs/types/components/Datatable/use-pagination-props.hook.d.ts +1 -1
- package/dist/cjs/types/components/EmbbededNotification/EmbeddedNotification.d.ts +1 -1
- package/dist/cjs/types/components/Form/DatePicker/DatePicker.d.ts +5 -4
- package/dist/cjs/types/components/Form/MultiSelect/MultiSelect.d.ts +9 -4
- package/dist/cjs/types/components/Form/Select/Select.d.ts +8 -3
- package/dist/cjs/types/components/Form/TextField/TextField.d.ts +5 -4
- package/dist/cjs/types/components/IconButton/IconButton.d.ts +4 -1
- package/dist/cjs/types/components/IconProvider/IconProvider.d.ts +0 -1
- package/dist/cjs/types/components/Modal/Dialog/Dialog.d.ts +1 -1
- package/dist/cjs/types/components/Modal/Drawer/Drawer.d.ts +1 -1
- package/dist/cjs/types/components/Modal/modal.interface.d.ts +4 -4
- package/dist/cjs/types/components/NotistackAdapter/NotistackAdapter.d.ts +1 -2
- package/dist/cjs/types/components/UploadDocument/FileUploaderSingle.d.ts +0 -1
- package/dist/es/index.d.ts +44 -27
- package/dist/es/index.mjs +15 -15
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/types/DesignSystemProvider.d.ts +3 -3
- package/dist/es/types/components/Accordion/Accordion.d.ts +3 -1
- package/dist/es/types/components/Chip/Chip.d.ts +3 -3
- package/dist/es/types/components/Datatable/Datatable.d.ts +1 -1
- package/dist/es/types/components/Datatable/DatatableCellRender.d.ts +0 -1
- package/dist/es/types/components/Datatable/datatable.interface.d.ts +1 -1
- package/dist/es/types/components/Datatable/use-pagination-props.hook.d.ts +1 -1
- package/dist/es/types/components/EmbbededNotification/EmbeddedNotification.d.ts +1 -1
- package/dist/es/types/components/Form/DatePicker/DatePicker.d.ts +5 -4
- package/dist/es/types/components/Form/MultiSelect/MultiSelect.d.ts +9 -4
- package/dist/es/types/components/Form/Select/Select.d.ts +8 -3
- package/dist/es/types/components/Form/TextField/TextField.d.ts +5 -4
- package/dist/es/types/components/IconButton/IconButton.d.ts +4 -1
- package/dist/es/types/components/IconProvider/IconProvider.d.ts +0 -1
- package/dist/es/types/components/Modal/Dialog/Dialog.d.ts +1 -1
- package/dist/es/types/components/Modal/Drawer/Drawer.d.ts +1 -1
- package/dist/es/types/components/Modal/modal.interface.d.ts +4 -4
- package/dist/es/types/components/NotistackAdapter/NotistackAdapter.d.ts +1 -2
- package/dist/es/types/components/UploadDocument/FileUploaderSingle.d.ts +0 -1
- package/package.json +31 -33
- package/src/DesignSystemProvider.tsx +3 -8
- package/src/components/Accordion/Accordion.tsx +5 -3
- package/src/components/BannerNotification/BannerNotification.tsx +2 -3
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/src/components/Button/Button.tsx +6 -6
- package/src/components/Chip/Chip.tsx +32 -29
- package/src/components/Datatable/Datatable.tsx +4 -4
- package/src/components/Datatable/datatable.interface.ts +1 -1
- package/src/components/Datatable/use-pagination-props.hook.ts +3 -3
- package/src/components/EmbbededNotification/EmbeddedNotification.tsx +8 -7
- package/src/components/Form/AutoCompleteMulti/AutoCompleteMulti.tsx +11 -7
- package/src/components/Form/AutoCompleteSingle/AutoCompleteSingle.tsx +8 -3
- package/src/components/Form/Checkbox/Checkbox.tsx +5 -5
- package/src/components/Form/CheckboxGroup/CheckboxGroup.tsx +1 -1
- package/src/components/Form/DatePicker/DatePicker.tsx +7 -6
- package/src/components/Form/MultiSelect/MultiSelect.tsx +22 -17
- package/src/components/Form/RadioGroup/RadioGroup.tsx +6 -6
- package/src/components/Form/Select/Select.tsx +21 -18
- package/src/components/Form/Switch/Switch.tsx +1 -1
- package/src/components/Form/TextField/TextField.tsx +5 -3
- package/src/components/IconButton/IconButton.tsx +12 -3
- package/src/components/IconProvider/IconProvider.tsx +36 -24
- package/src/components/Link/Link.tsx +5 -8
- package/src/components/Modal/Drawer/Drawer.tsx +1 -2
- package/src/components/Modal/modal.interface.ts +4 -4
- package/src/components/NotistackAdapter/NotistackAdapter.tsx +4 -3
- package/src/components/Pagination/Pagination.tsx +2 -2
- package/src/components/Snackbar/Snackbar.tsx +4 -4
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +10 -12
- package/src/components/UploadDocument/FileUploaderSingle.tsx +1 -2
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Link as LinkMui, LinkProps, styled, useTheme } from '@mui/material';
|
|
1
|
+
import { useMemo } from 'react';
|
|
3
2
|
|
|
4
3
|
import { LinkStyle } from '@groupeactual/design-tokens';
|
|
4
|
+
import { Link as LinkMui, LinkProps, styled, useTheme } from '@mui/material';
|
|
5
5
|
|
|
6
6
|
interface Props extends Omit<LinkProps, 'variant'> {
|
|
7
7
|
variant?: 'link1' | 'link2';
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
9
|
component?: any;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const Link = (props: Props) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
() => styled(LinkMui)(LinkStyle(theme)),
|
|
15
|
-
[theme]
|
|
16
|
-
);
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
const StyledLink = useMemo(() => styled(LinkMui)(LinkStyle(theme)), [theme]);
|
|
17
15
|
return <StyledLink {...(props as LinkProps)} />;
|
|
18
|
-
|
|
19
16
|
};
|
|
20
17
|
|
|
21
18
|
Link.displayName = 'Link';
|
|
@@ -22,7 +22,6 @@ const Drawer = ({
|
|
|
22
22
|
}: Omit<ModalProps, 'withHeaderDivider' | 'icon'>) => {
|
|
23
23
|
return (
|
|
24
24
|
<DrawerMUI
|
|
25
|
-
disableEnforceFocus
|
|
26
25
|
anchor="right"
|
|
27
26
|
open={open}
|
|
28
27
|
onClose={() => onClose?.()}
|
|
@@ -38,7 +37,7 @@ const Drawer = ({
|
|
|
38
37
|
},
|
|
39
38
|
'.MuiCardContent-root': {
|
|
40
39
|
padding: '10px 24px 24px 24px',
|
|
41
|
-
color: 'greyXDark'
|
|
40
|
+
color: 'greyXDark',
|
|
42
41
|
},
|
|
43
42
|
}}
|
|
44
43
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
4
4
|
import { CardProps } from '@mui/material';
|
|
@@ -17,8 +17,8 @@ export interface ModalProps
|
|
|
17
17
|
open: boolean;
|
|
18
18
|
title?: string;
|
|
19
19
|
size?: 'small' | 'large';
|
|
20
|
-
component:
|
|
21
|
-
footer?:
|
|
20
|
+
component: ReactNode | null;
|
|
21
|
+
footer?: ReactNode | null;
|
|
22
22
|
cardProps?: Partial<CardProps>;
|
|
23
23
|
className?: string;
|
|
24
24
|
icon?: IconDefinition;
|
|
@@ -27,7 +27,7 @@ export interface ModalProps
|
|
|
27
27
|
|
|
28
28
|
export type DialogTitleProps<T extends OverridableTypeMap> =
|
|
29
29
|
DefaultComponentProps<T> & {
|
|
30
|
-
children?:
|
|
30
|
+
children?: ReactNode;
|
|
31
31
|
icon?: IconDefinition | null;
|
|
32
32
|
onClose: () => void;
|
|
33
33
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import { CustomContentProps, SnackbarContent } from 'notistack';
|
|
2
4
|
|
|
3
5
|
import Snackbar from '../Snackbar/Snackbar';
|
|
4
|
-
import { SnackbarContent, CustomContentProps } from 'notistack';
|
|
5
6
|
|
|
6
7
|
const NotistackAdapter = forwardRef<HTMLDivElement, CustomContentProps>(
|
|
7
8
|
({ message, variant }, ref) => {
|
|
@@ -13,7 +14,7 @@ const NotistackAdapter = forwardRef<HTMLDivElement, CustomContentProps>(
|
|
|
13
14
|
<Snackbar text={message} severity={variant} />
|
|
14
15
|
</SnackbarContent>
|
|
15
16
|
);
|
|
16
|
-
}
|
|
17
|
+
},
|
|
17
18
|
);
|
|
18
19
|
NotistackAdapter.displayName = 'NotistackAdapter';
|
|
19
20
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ChangeEvent, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { PaginationStyle } from '@groupeactual/design-tokens';
|
|
4
4
|
import {
|
|
@@ -133,7 +133,7 @@ const Pagination = ({
|
|
|
133
133
|
shape="rounded"
|
|
134
134
|
count={displayablePages}
|
|
135
135
|
page={internalPage}
|
|
136
|
-
onChange={(_:
|
|
136
|
+
onChange={(_: ChangeEvent<unknown>, value: number) =>
|
|
137
137
|
changePage(value)
|
|
138
138
|
}
|
|
139
139
|
/>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import {
|
|
4
4
|
IconDefinition,
|
|
5
5
|
faCheckCircle,
|
|
6
6
|
faExclamationCircle,
|
|
7
|
-
faTimesCircle
|
|
7
|
+
faTimesCircle,
|
|
8
8
|
} from '@fortawesome/pro-solid-svg-icons';
|
|
9
|
-
|
|
10
9
|
import { SnackbarStyle } from '@groupeactual/design-tokens';
|
|
10
|
+
import { Alert, AlertProps, styled, useTheme } from '@mui/material';
|
|
11
11
|
|
|
12
12
|
import IconProvider from '../IconProvider/IconProvider';
|
|
13
13
|
|
|
@@ -20,7 +20,7 @@ const Snackbar = ({ text, severity }: Props) => {
|
|
|
20
20
|
const theme = useTheme();
|
|
21
21
|
const StyledSnackbar = useMemo(
|
|
22
22
|
() => styled(Alert)(SnackbarStyle(theme)),
|
|
23
|
-
[theme]
|
|
23
|
+
[theme],
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
let alertIcon: IconDefinition;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Typography, TypographyProps } from '@mui/material';
|
|
3
2
|
|
|
4
3
|
interface Props extends Omit<TypographyProps, 'variant'> {
|
|
@@ -24,6 +23,7 @@ interface Props extends Omit<TypographyProps, 'variant'> {
|
|
|
24
23
|
| 'h4'
|
|
25
24
|
| 'link1'
|
|
26
25
|
| 'link2';
|
|
26
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
27
27
|
component?: any;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
Tooltip as TooltipMui,
|
|
6
6
|
TooltipProps,
|
|
7
7
|
styled,
|
|
8
|
-
tooltipClasses
|
|
8
|
+
tooltipClasses,
|
|
9
9
|
} from '@mui/material';
|
|
10
10
|
|
|
11
11
|
import { Placement } from './tooltip.interface';
|
|
@@ -25,31 +25,29 @@ const Tooltip = ({
|
|
|
25
25
|
if (!title) {
|
|
26
26
|
return <>{children}</>;
|
|
27
27
|
}
|
|
28
|
-
const StyledTooltip = styled(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
)
|
|
32
|
-
)(() => ({
|
|
28
|
+
const StyledTooltip = styled(({ classes, ...tooltipProps }: TooltipProps) => (
|
|
29
|
+
<TooltipMui {...tooltipProps} classes={classes} />
|
|
30
|
+
))(() => ({
|
|
33
31
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
34
32
|
backgroundColor: '#272727',
|
|
35
33
|
padding: '4px !important',
|
|
36
34
|
fontFamily: 'Roboto, sans-serif',
|
|
37
35
|
fontSize: '13px',
|
|
38
36
|
color: 'white',
|
|
39
|
-
fontWeight: 400
|
|
37
|
+
fontWeight: 400,
|
|
40
38
|
},
|
|
41
39
|
[`& .${tooltipClasses.tooltipPlacementTop}`]: {
|
|
42
|
-
marginBottom: '4px !important'
|
|
40
|
+
marginBottom: '4px !important',
|
|
43
41
|
},
|
|
44
42
|
[`& .${tooltipClasses.tooltipPlacementRight}`]: {
|
|
45
|
-
marginLeft: '4px !important'
|
|
43
|
+
marginLeft: '4px !important',
|
|
46
44
|
},
|
|
47
45
|
[`& .${tooltipClasses.tooltipPlacementBottom}`]: {
|
|
48
|
-
marginTop: '4px !important'
|
|
46
|
+
marginTop: '4px !important',
|
|
49
47
|
},
|
|
50
48
|
[`& .${tooltipClasses.tooltipPlacementLeft}`]: {
|
|
51
|
-
marginRight: '4px !important'
|
|
52
|
-
}
|
|
49
|
+
marginRight: '4px !important',
|
|
50
|
+
},
|
|
53
51
|
}));
|
|
54
52
|
|
|
55
53
|
return (
|
|
@@ -2,8 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { faEye, faTrash, faUpload } from '@fortawesome/pro-regular-svg-icons';
|
|
4
4
|
import { faFileAlt } from '@fortawesome/pro-solid-svg-icons';
|
|
5
|
-
import { IconButton } from '@mui/material';
|
|
6
|
-
import Box from '@mui/material/Box';
|
|
5
|
+
import { Box, IconButton } from '@mui/material';
|
|
7
6
|
|
|
8
7
|
import Button from '../Button/Button';
|
|
9
8
|
import IconProvider from '../IconProvider/IconProvider';
|