@groupeactual/ui-kit 1.5.2-beta.5 → 1.6.0-beta.10
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 +4 -3
- 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 +43 -26
- 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 +4 -3
- 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 +33 -35
- 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 +19 -18
- 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 +6 -5
- 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,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
type Theme = 'Default' | 'Ep';
|
|
3
3
|
export interface DesignSystemContextValues {
|
|
4
4
|
isDarkTheme: boolean;
|
|
5
5
|
themeName: Theme;
|
|
6
6
|
toggleDarkTheme: () => void;
|
|
7
7
|
}
|
|
8
|
-
export declare const DesignSystemContext:
|
|
8
|
+
export declare const DesignSystemContext: import("react").Context<DesignSystemContextValues>;
|
|
9
9
|
interface Props {
|
|
10
10
|
name?: Theme;
|
|
11
11
|
}
|
|
12
|
-
declare const DesignSystemProvider: ({ children, name: themeName }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const DesignSystemProvider: ({ children, name: themeName, }: PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default DesignSystemProvider;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
1
|
+
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { AccordionProps } from '@mui/material';
|
|
3
3
|
interface Props extends AccordionProps {
|
|
4
4
|
title?: string;
|
|
5
5
|
summaryHeight?: number;
|
|
6
6
|
expanded?: boolean;
|
|
7
|
+
children: NonNullable<ReactNode>;
|
|
8
|
+
disabled?: boolean;
|
|
7
9
|
onClick?: MouseEventHandler;
|
|
8
10
|
}
|
|
9
11
|
declare const Accordion: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ChipProps as ChipPropsMUI } from '@mui/material';
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
3
2
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
import { ChipProps as ChipPropsMUI } from '@mui/material';
|
|
4
4
|
interface Props extends Omit<ChipPropsMUI, 'suffix' | 'prefix' | 'onDelete' | 'onDeleteIcon' | 'variant'> {
|
|
5
5
|
variant: 'filled' | 'outlined' | 'status' | 'statusFilled';
|
|
6
6
|
label: string;
|
|
7
7
|
prefixIcon?: IconDefinition;
|
|
8
8
|
suffixIcon?: IconDefinition;
|
|
9
|
-
suffixAction?: (e:
|
|
9
|
+
suffixAction?: (e: MouseEvent) => void;
|
|
10
10
|
suffixTooltip?: string;
|
|
11
11
|
tooltip?: string;
|
|
12
12
|
maxWidth?: string | number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Props } from './datatable.interface';
|
|
2
|
-
declare const Datatable: <T extends
|
|
2
|
+
declare const Datatable: <T extends object>({ onLoad, onSort, sortInfo, withHeader, withPagination, columns, ...props }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Datatable;
|
|
@@ -49,5 +49,5 @@ type WithDetailsProps<T, D> = {
|
|
|
49
49
|
type WithoutDetailsProps<T> = {
|
|
50
50
|
onLoad: () => Promise<DatatableDataSet<T>>;
|
|
51
51
|
};
|
|
52
|
-
export type Props<T extends
|
|
52
|
+
export type Props<T extends object> = BaseProps<T> & (WithoutPaginationProps | PaginationProps) & (WithDetailsProps<T, RowDetail> | WithoutDetailsProps<T>);
|
|
53
53
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PaginationProps, Props } from './datatable.interface';
|
|
2
|
-
declare const usePaginationProps: <T extends
|
|
2
|
+
declare const usePaginationProps: <T extends object>(props: Props<T> | object) => Omit<PaginationProps, "withPagination">;
|
|
3
3
|
export default usePaginationProps;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { DatePickerProps } from '@mui/x-date-pickers-pro';
|
|
2
|
+
import { Dayjs } from 'dayjs';
|
|
2
3
|
import 'dayjs/locale/fr';
|
|
3
|
-
interface Props<T> extends Omit<DatePickerProps<T>, 'onChange' | 'width'> {
|
|
4
|
-
value: T;
|
|
4
|
+
interface Props<T extends Dayjs> extends Omit<DatePickerProps<T>, 'onChange' | 'width'> {
|
|
5
|
+
value: T | null;
|
|
5
6
|
onChange: (value: T | null) => void;
|
|
6
7
|
error?: string;
|
|
7
8
|
success?: boolean;
|
|
@@ -9,5 +10,5 @@ interface Props<T> extends Omit<DatePickerProps<T>, 'onChange' | 'width'> {
|
|
|
9
10
|
width?: string;
|
|
10
11
|
locale?: 'fr' | 'en';
|
|
11
12
|
}
|
|
12
|
-
declare const DatePicker: <T extends
|
|
13
|
+
declare const DatePicker: <T extends Dayjs>({ value, onChange, error, success, helperText, width, locale, ...props }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export default DatePicker;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
import { FocusEventHandler } from 'react';
|
|
1
2
|
import { SelectProps } from '@mui/material';
|
|
2
3
|
interface Props<T> extends Omit<SelectProps<T[]>, 'value' | 'onChange' | 'value' | 'color' | 'error'> {
|
|
3
4
|
label: string;
|
|
4
5
|
options: T[] | [];
|
|
5
6
|
helperText?: string;
|
|
6
7
|
color?: 'success';
|
|
7
|
-
onChange: (value: T[]) => void;
|
|
8
|
-
getRenderValue: (option: T) => string;
|
|
9
|
-
getKeyValue: (option: T) => string;
|
|
10
8
|
value: T[];
|
|
11
9
|
width?: number | string;
|
|
12
10
|
error?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
15
|
+
onChange: (value: T[]) => void;
|
|
16
|
+
getRenderValue: (option: T) => string;
|
|
17
|
+
getKeyValue: (option: T) => string;
|
|
13
18
|
}
|
|
14
19
|
declare const MultiSelect: {
|
|
15
|
-
<T>({ value, label, options, color, error, placeholder, helperText, width, getRenderValue, getKeyValue, onChange,
|
|
20
|
+
<T>({ value, label, options, color, error, placeholder, helperText, width, getRenderValue, getKeyValue, onChange, disabled, ...props }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
16
21
|
displayName: string;
|
|
17
22
|
};
|
|
18
23
|
export default MultiSelect;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
import { BaseSyntheticEvent } from 'react';
|
|
1
2
|
import { SelectProps } from '@mui/material';
|
|
2
3
|
interface Props<T> extends Omit<SelectProps<T>, 'value' | 'onChange' | 'color' | 'error'> {
|
|
3
4
|
options: T[];
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
6
7
|
label: string;
|
|
7
8
|
helperText?: string;
|
|
8
9
|
color?: 'success';
|
|
9
10
|
value: T | undefined;
|
|
10
11
|
width?: number | string;
|
|
11
12
|
error?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
getRenderValue: (option: T) => string;
|
|
15
|
+
onChange: (value: T) => void;
|
|
16
|
+
onBlur?: (event: BaseSyntheticEvent) => void;
|
|
12
17
|
}
|
|
13
18
|
declare const Select: {
|
|
14
|
-
<T>({ value, label, options, color, error, placeholder,
|
|
19
|
+
<T>({ value, label, options, color, error, placeholder, helperText, width, disabled, onChange, getRenderValue, ...props }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
15
20
|
displayName: string;
|
|
16
21
|
};
|
|
17
22
|
export default Select;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { FocusEventHandler, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React, { FocusEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
3
|
interface Props extends Omit<TextFieldProps, 'error'> {
|
|
4
4
|
error?: string;
|
|
5
|
-
onBlur?: FocusEventHandler<unknown>;
|
|
6
|
-
onChange?: StandardInputProps['onChange'];
|
|
7
5
|
label: string;
|
|
8
6
|
value?: string | unknown;
|
|
9
7
|
name?: string;
|
|
@@ -12,6 +10,9 @@ interface Props extends Omit<TextFieldProps, 'error'> {
|
|
|
12
10
|
endAdornment?: ReactNode;
|
|
13
11
|
maxLength?: number;
|
|
14
12
|
width?: number | string;
|
|
13
|
+
className?: string;
|
|
14
|
+
onBlur?: FocusEventHandler<unknown>;
|
|
15
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
15
16
|
}
|
|
16
17
|
declare const TextField: {
|
|
17
18
|
({ name, value, error, onBlur, onChange, label, disabled, width, endAdornment, placeholder, maxLength, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import { IconButtonProps } from '@mui/material';
|
|
2
|
+
import { IconButtonProps, SxProps, Theme } from '@mui/material';
|
|
3
3
|
import { Placement } from '../Tooltip/tooltip.interface';
|
|
4
4
|
interface Props extends IconButtonProps {
|
|
5
5
|
icon: IconDefinition;
|
|
@@ -7,6 +7,9 @@ interface Props extends IconButtonProps {
|
|
|
7
7
|
positionGroup?: 'left' | 'middle' | 'right';
|
|
8
8
|
tooltipText?: string;
|
|
9
9
|
tooltipPosition?: Placement;
|
|
10
|
+
size?: 'small' | 'medium';
|
|
11
|
+
sx?: SxProps<Theme>;
|
|
12
|
+
onClick?: (e: any) => void;
|
|
10
13
|
}
|
|
11
14
|
declare const IconButton: {
|
|
12
15
|
({ icon, variant, positionGroup, tooltipText, tooltipPosition, size, ...iconButtonProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ModalProps } from '../modal.interface';
|
|
2
|
-
declare const Dialog: ({ title, open, onClose, component, icon, ...props }: Omit<ModalProps,
|
|
2
|
+
declare const Dialog: ({ title, open, onClose, component, icon, ...props }: Omit<ModalProps, "footer" | "cardProps" | "size">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Dialog;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ModalProps } from '../modal.interface';
|
|
2
|
-
declare const Drawer: ({ title, open, onClose, component, footer, cardProps, size, ...props }: Omit<ModalProps,
|
|
2
|
+
declare const Drawer: ({ title, open, onClose, component, footer, cardProps, size, ...props }: Omit<ModalProps, "withHeaderDivider" | "icon">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Drawer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
import { CardProps } from '@mui/material';
|
|
4
4
|
import { ModalProps as ModalPropsMUI } from '@mui/material/Modal';
|
|
@@ -10,15 +10,15 @@ export interface ModalProps extends Omit<ModalPropsMUI, 'component' | 'open' | '
|
|
|
10
10
|
open: boolean;
|
|
11
11
|
title?: string;
|
|
12
12
|
size?: 'small' | 'large';
|
|
13
|
-
component:
|
|
14
|
-
footer?:
|
|
13
|
+
component: ReactNode | null;
|
|
14
|
+
footer?: ReactNode | null;
|
|
15
15
|
cardProps?: Partial<CardProps>;
|
|
16
16
|
className?: string;
|
|
17
17
|
icon?: IconDefinition;
|
|
18
18
|
onClose?: () => void;
|
|
19
19
|
}
|
|
20
20
|
export type DialogTitleProps<T extends OverridableTypeMap> = DefaultComponentProps<T> & {
|
|
21
|
-
children?:
|
|
21
|
+
children?: ReactNode;
|
|
22
22
|
icon?: IconDefinition | null;
|
|
23
23
|
onClose: () => void;
|
|
24
24
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { CustomContentProps } from 'notistack';
|
|
3
|
-
declare const NotistackAdapter:
|
|
2
|
+
declare const NotistackAdapter: import("react").ForwardRefExoticComponent<CustomContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
3
|
export default NotistackAdapter;
|
package/package.json
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groupeactual/ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-beta.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A simple template for a custom React component library",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@
|
|
8
|
-
"@babel/
|
|
9
|
-
"@babel/preset-
|
|
10
|
-
"@babel/preset-
|
|
11
|
-
"@
|
|
7
|
+
"@groupeactual/code-quality-front": "1.2.0-beta.8",
|
|
8
|
+
"@babel/core": "^7.25.2",
|
|
9
|
+
"@babel/preset-env": "^7.25.4",
|
|
10
|
+
"@babel/preset-react": "^7.24.7",
|
|
11
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
12
12
|
"@mdx-js/react": "^3.0.1",
|
|
13
|
-
"@types/lodash": "^4.17.
|
|
14
|
-
"@types/react": "^18.
|
|
13
|
+
"@types/lodash": "^4.17.7",
|
|
14
|
+
"@types/react": "^18.3.4",
|
|
15
15
|
"@types/styled-components": "^5.1.34",
|
|
16
16
|
"babel-loader": "^9.1.3",
|
|
17
|
-
"clsx": "^2.1.
|
|
18
|
-
"css-loader": "^7.1.
|
|
19
|
-
"framer-motion": "^11.
|
|
20
|
-
"html-webpack-plugin": "^5.6.0",
|
|
17
|
+
"clsx": "^2.1.1",
|
|
18
|
+
"css-loader": "^7.1.2",
|
|
19
|
+
"framer-motion": "^11.3.29",
|
|
21
20
|
"identity-obj-proxy": "^3.0.0",
|
|
22
21
|
"lodash": "^4.17.21",
|
|
23
|
-
"postcss": "^8.4.
|
|
24
|
-
"prettier": "^3.
|
|
22
|
+
"postcss": "^8.4.41",
|
|
23
|
+
"prettier": "^3.3.3",
|
|
25
24
|
"prop-types": "^15.8.1",
|
|
26
|
-
"sass": "^1.
|
|
27
|
-
"sass-loader": "^
|
|
25
|
+
"sass": "^1.77.8",
|
|
26
|
+
"sass-loader": "^16.0.1",
|
|
28
27
|
"style-loader": "^4.0.0",
|
|
29
|
-
"styled-components": "^6.1.
|
|
30
|
-
"tslib": "^2.6.
|
|
31
|
-
"typescript": "^
|
|
32
|
-
"webpack": "^5.91.0"
|
|
28
|
+
"styled-components": "^6.1.12",
|
|
29
|
+
"tslib": "^2.6.3",
|
|
30
|
+
"typescript": "^5.5.4"
|
|
33
31
|
},
|
|
34
32
|
"main": "dist/cjs/index.js",
|
|
35
33
|
"module": "dist/es/index.mjs",
|
|
@@ -39,26 +37,26 @@
|
|
|
39
37
|
],
|
|
40
38
|
"types": "dist/es/types/index.d.ts",
|
|
41
39
|
"dependencies": {
|
|
42
|
-
"@emotion/is-prop-valid": "^1.
|
|
43
|
-
"@emotion/react": "^11.
|
|
44
|
-
"@emotion/serialize": "^1.1
|
|
45
|
-
"@emotion/styled": "^11.
|
|
46
|
-
"@fortawesome/fontawesome-svg-core": "^6.
|
|
40
|
+
"@emotion/is-prop-valid": "^1.3.0",
|
|
41
|
+
"@emotion/react": "^11.13.3",
|
|
42
|
+
"@emotion/serialize": "^1.3.1",
|
|
43
|
+
"@emotion/styled": "^11.13.0",
|
|
44
|
+
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
|
47
45
|
"@fortawesome/pro-regular-svg-icons": "git+https://github.com/actualtysoft/pro-regular-svg-icons.git#6.4.2",
|
|
48
46
|
"@fortawesome/pro-solid-svg-icons": "git+https://github.com/actualtysoft/pro-solid-svg-icons.git#6.4.2",
|
|
49
|
-
"@mui/material": "^5.
|
|
50
|
-
"@mui/system": "^5.
|
|
51
|
-
"@mui/x-date-pickers": "^
|
|
52
|
-
"@mui/x-date-pickers-pro": "^
|
|
53
|
-
"dayjs": "^1.11.
|
|
47
|
+
"@mui/material": "^5.16.7",
|
|
48
|
+
"@mui/system": "^5.16.7",
|
|
49
|
+
"@mui/x-date-pickers": "^7.13.0",
|
|
50
|
+
"@mui/x-date-pickers-pro": "^7.13.0",
|
|
51
|
+
"dayjs": "^1.11.13",
|
|
54
52
|
"notistack": "^3.0.1",
|
|
55
|
-
"react": "^18.
|
|
56
|
-
"react-dom": "^18.
|
|
57
|
-
"@groupeactual/design-tokens": "1.
|
|
53
|
+
"react": "^18.3.1",
|
|
54
|
+
"react-dom": "^18.3.1",
|
|
55
|
+
"@groupeactual/design-tokens": "1.6.0-beta.10"
|
|
58
56
|
},
|
|
59
57
|
"peerDependencies": {
|
|
60
|
-
"react": "^18.
|
|
61
|
-
"react-dom": "^18.
|
|
58
|
+
"react": "^18.3.1",
|
|
59
|
+
"react-dom": "^18.3.1"
|
|
62
60
|
},
|
|
63
61
|
"scripts": {
|
|
64
62
|
"build": "rollup -c",
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
PropsWithChildren,
|
|
3
|
-
createContext,
|
|
4
|
-
useContext,
|
|
5
|
-
useState
|
|
6
|
-
} from 'react';
|
|
1
|
+
import { PropsWithChildren, createContext, useContext, useState } from 'react';
|
|
7
2
|
|
|
8
3
|
import { useMaterialThemeTokens } from '@groupeactual/design-tokens';
|
|
9
4
|
import { ThemeProvider, createTheme } from '@mui/material';
|
|
@@ -24,7 +19,7 @@ export const DesignSystemContext = createContext<DesignSystemContextValues>({
|
|
|
24
19
|
themeName: 'Default',
|
|
25
20
|
toggleDarkTheme: () => {
|
|
26
21
|
return;
|
|
27
|
-
}
|
|
22
|
+
},
|
|
28
23
|
});
|
|
29
24
|
|
|
30
25
|
interface Props {
|
|
@@ -42,7 +37,7 @@ const MaterialThemeProvider = ({ children }: PropsWithChildren<unknown>) => {
|
|
|
42
37
|
|
|
43
38
|
const DesignSystemProvider = ({
|
|
44
39
|
children,
|
|
45
|
-
name: themeName = 'Default'
|
|
40
|
+
name: themeName = 'Default',
|
|
46
41
|
}: PropsWithChildren<Props>) => {
|
|
47
42
|
const [isDarkTheme, setIsDarkTheme] = useState(false);
|
|
48
43
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
2
|
MouseEventHandler,
|
|
3
3
|
ReactNode,
|
|
4
4
|
useEffect,
|
|
@@ -23,6 +23,8 @@ interface Props extends AccordionProps {
|
|
|
23
23
|
title?: string;
|
|
24
24
|
summaryHeight?: number;
|
|
25
25
|
expanded?: boolean;
|
|
26
|
+
children: NonNullable<ReactNode>;
|
|
27
|
+
disabled?: boolean;
|
|
26
28
|
onClick?: MouseEventHandler;
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -74,9 +76,9 @@ const Accordion = ({
|
|
|
74
76
|
</AccordionSummary>
|
|
75
77
|
<AccordionDetails
|
|
76
78
|
sx={{
|
|
77
|
-
backgroundColor:
|
|
79
|
+
backgroundColor: theme.palette.greyXLight,
|
|
78
80
|
borderTop: '1px solid',
|
|
79
|
-
borderColor:
|
|
81
|
+
borderColor: theme.palette.greyLightDefaultBorder,
|
|
80
82
|
}}
|
|
81
83
|
>
|
|
82
84
|
{children}
|
|
@@ -2,8 +2,7 @@ import { useMemo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { faBell, faTimes } from '@fortawesome/pro-solid-svg-icons';
|
|
4
4
|
import { BannerNotificationStyle } from '@groupeactual/design-tokens';
|
|
5
|
-
import { Alert, AlertProps, styled } from '@mui/material';
|
|
6
|
-
import { useTheme } from '@mui/material';
|
|
5
|
+
import { Alert, AlertProps, styled, useTheme } from '@mui/material';
|
|
7
6
|
|
|
8
7
|
import IconProvider from '../IconProvider/IconProvider';
|
|
9
8
|
|
|
@@ -17,7 +16,7 @@ const BannerNotification = ({ text, severity, onClose }: Props) => {
|
|
|
17
16
|
|
|
18
17
|
const StyledBannerNotification = useMemo(
|
|
19
18
|
() => styled(Alert)(BannerNotificationStyle(theme)),
|
|
20
|
-
[]
|
|
19
|
+
[],
|
|
21
20
|
);
|
|
22
21
|
|
|
23
22
|
return (
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import { BreadcrumbsStyle } from '@groupeactual/design-tokens';
|
|
4
4
|
import {
|
|
5
5
|
Breadcrumbs as BreadcrumbsMui,
|
|
6
6
|
BreadcrumbsProps,
|
|
7
7
|
styled,
|
|
8
|
-
useTheme
|
|
8
|
+
useTheme,
|
|
9
9
|
} from '@mui/material';
|
|
10
10
|
|
|
11
11
|
import Link from '../Link';
|
|
@@ -25,7 +25,7 @@ const Breadcrumbs = ({ PageName, links, ...props }: Props) => {
|
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
const StyledBreadcrumbs = useMemo(
|
|
27
27
|
() => styled(BreadcrumbsMui)(BreadcrumbsStyle(theme)),
|
|
28
|
-
[theme]
|
|
28
|
+
[theme],
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
return (
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { ButtonStyle } from '@groupeactual/design-tokens';
|
|
2
4
|
import {
|
|
3
5
|
Button as ButtonMUI,
|
|
4
|
-
styled,
|
|
5
6
|
ButtonProps,
|
|
6
|
-
|
|
7
|
+
styled,
|
|
8
|
+
useTheme,
|
|
7
9
|
} from '@mui/material';
|
|
8
10
|
|
|
9
|
-
import { ButtonStyle } from '@groupeactual/design-tokens';
|
|
10
|
-
|
|
11
11
|
interface Props extends Omit<ButtonProps, 'variant' | 'children'> {
|
|
12
12
|
variant?: 'primary' | 'secondary';
|
|
13
13
|
children?: ReactNode;
|
|
@@ -17,7 +17,7 @@ const Button = ({ variant, children, ...props }: Props) => {
|
|
|
17
17
|
const theme = useTheme();
|
|
18
18
|
const StyledButton = useMemo(
|
|
19
19
|
() => styled(ButtonMUI)(ButtonStyle(theme)),
|
|
20
|
-
[theme]
|
|
20
|
+
[theme],
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
return (
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MouseEvent, useMemo, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
4
|
+
import { ChipStyle } from '@groupeactual/design-tokens';
|
|
2
5
|
import {
|
|
3
6
|
Box,
|
|
4
7
|
Chip as ChipMUI,
|
|
8
|
+
ChipProps as ChipPropsMUI,
|
|
5
9
|
Tooltip,
|
|
6
10
|
styled,
|
|
7
|
-
|
|
8
|
-
useTheme
|
|
11
|
+
useTheme,
|
|
9
12
|
} from '@mui/material';
|
|
10
|
-
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
11
|
-
|
|
12
|
-
import { ChipStyle } from '@groupeactual/design-tokens';
|
|
13
13
|
|
|
14
14
|
import IconProvider from '../IconProvider';
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@ interface Props
|
|
|
22
22
|
label: string;
|
|
23
23
|
prefixIcon?: IconDefinition;
|
|
24
24
|
suffixIcon?: IconDefinition;
|
|
25
|
-
suffixAction?: (e:
|
|
25
|
+
suffixAction?: (e: MouseEvent) => void;
|
|
26
26
|
suffixTooltip?: string;
|
|
27
27
|
tooltip?: string;
|
|
28
28
|
maxWidth?: string | number;
|
|
@@ -49,11 +49,12 @@ const Chip = ({
|
|
|
49
49
|
const ref = useRef<HTMLDivElement>(null);
|
|
50
50
|
|
|
51
51
|
let backgroundColor: string =
|
|
52
|
+
// eslint-disable-next-line no-nested-ternary
|
|
52
53
|
props.color && theme.palette[props.color]
|
|
53
54
|
? typeof theme.palette[props.color] === 'object'
|
|
54
55
|
? theme.palette[props.color]['main']
|
|
55
56
|
: theme.palette[props.color]
|
|
56
|
-
: props.color ?? 'white';
|
|
57
|
+
: (props.color ?? 'white');
|
|
57
58
|
|
|
58
59
|
if (variant === 'filled' || variant === 'statusFilled') {
|
|
59
60
|
// opacity 0.08
|
|
@@ -88,24 +89,24 @@ const Chip = ({
|
|
|
88
89
|
'&:hover': {
|
|
89
90
|
borderColor: '#004f88 !important',
|
|
90
91
|
'.MuiChip-deleteIcon': {
|
|
91
|
-
color: '#004f88 !important'
|
|
92
|
-
}
|
|
93
|
-
}
|
|
92
|
+
color: '#004f88 !important',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
94
95
|
},
|
|
95
96
|
'&.MuiChip-colorPrimary': suffixIcon &&
|
|
96
97
|
suffixAction && {
|
|
97
98
|
'&:hover': {
|
|
98
|
-
backgroundColor: '#004f88 !important'
|
|
99
|
-
}
|
|
99
|
+
backgroundColor: '#004f88 !important',
|
|
100
|
+
},
|
|
100
101
|
},
|
|
101
102
|
'&.MuiChip-colorDefault': suffixIcon &&
|
|
102
103
|
suffixAction && {
|
|
103
104
|
'&:hover': {
|
|
104
105
|
'.MuiChip-deleteIcon': {
|
|
105
|
-
color: '#004f88 !important'
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
106
|
+
color: '#004f88 !important',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
109
110
|
}}
|
|
110
111
|
avatar={
|
|
111
112
|
prefixIcon ? <IconProvider icon={prefixIcon} size="sm" /> : <></>
|
|
@@ -127,7 +128,7 @@ const Chip = ({
|
|
|
127
128
|
}
|
|
128
129
|
}}
|
|
129
130
|
sx={{
|
|
130
|
-
cursor: suffixAction ? 'pointer !important' : 'default'
|
|
131
|
+
cursor: suffixAction ? 'pointer !important' : 'default',
|
|
131
132
|
}}
|
|
132
133
|
size="sm"
|
|
133
134
|
/>
|
|
@@ -24,7 +24,7 @@ import Text from '../Text';
|
|
|
24
24
|
import { RowDetail as D, Props } from './datatable.interface';
|
|
25
25
|
import usePaginationProps from './use-pagination-props.hook';
|
|
26
26
|
|
|
27
|
-
const Datatable = <T extends
|
|
27
|
+
const Datatable = <T extends object>({
|
|
28
28
|
onLoad,
|
|
29
29
|
onSort = () => undefined,
|
|
30
30
|
sortInfo = null,
|
|
@@ -102,10 +102,10 @@ const Datatable = <T extends {}>({
|
|
|
102
102
|
<TableCell
|
|
103
103
|
key={name}
|
|
104
104
|
variant="head"
|
|
105
|
-
height={hasTopTitle ? '55px' : 'inherit'}
|
|
106
105
|
sx={{
|
|
107
106
|
width: width,
|
|
108
107
|
maxWidth: width,
|
|
108
|
+
height: hasTopTitle ? '55px' : 'inherit',
|
|
109
109
|
}}
|
|
110
110
|
>
|
|
111
111
|
{hasTopTitle && (
|
|
@@ -140,7 +140,7 @@ const Datatable = <T extends {}>({
|
|
|
140
140
|
icon={isAsc ? faArrowUpLong : faArrowDownLong}
|
|
141
141
|
variant="table"
|
|
142
142
|
size="small"
|
|
143
|
-
|
|
143
|
+
sx={{
|
|
144
144
|
visibility:
|
|
145
145
|
sortActive || hover === name
|
|
146
146
|
? 'visible'
|
|
@@ -184,7 +184,7 @@ const Datatable = <T extends {}>({
|
|
|
184
184
|
</TableRow>
|
|
185
185
|
{'details' in record && record.details && (
|
|
186
186
|
<TableRow>
|
|
187
|
-
<TableCell
|
|
187
|
+
<TableCell sx={{ columnSpan: columns.length }}>
|
|
188
188
|
{record.details}
|
|
189
189
|
</TableCell>
|
|
190
190
|
</TableRow>
|
|
@@ -61,6 +61,6 @@ type WithoutDetailsProps<T> = {
|
|
|
61
61
|
onLoad: () => Promise<DatatableDataSet<T>>;
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
export type Props<T extends
|
|
64
|
+
export type Props<T extends object> = BaseProps<T> &
|
|
65
65
|
(WithoutPaginationProps | PaginationProps) &
|
|
66
66
|
(WithDetailsProps<T, RowDetail> | WithoutDetailsProps<T>);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
2
|
import { PaginationProps, PaginationTrans, Props } from './datatable.interface';
|
|
3
3
|
|
|
4
|
-
const usePaginationProps = <T extends
|
|
5
|
-
props: Props<T> |
|
|
4
|
+
const usePaginationProps = <T extends object>(
|
|
5
|
+
props: Props<T> | object,
|
|
6
6
|
): Omit<PaginationProps, 'withPagination'> => {
|
|
7
7
|
let trans = {} as PaginationTrans;
|
|
8
8
|
let limits: number[] = [3, 5, 10, 20];
|
|
@@ -35,7 +35,7 @@ const usePaginationProps = <T extends {}>(
|
|
|
35
35
|
limits,
|
|
36
36
|
withTopPagination,
|
|
37
37
|
setPage,
|
|
38
|
-
setLimit
|
|
38
|
+
setLimit,
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|