@groupeactual/ui-kit 1.6.7-beta.0 → 1.7.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 +9 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.d.ts +132 -166
- package/dist/es/index.js +97 -0
- package/dist/es/index.js.map +1 -0
- package/dist/{cjs/types → es/src}/components/Accordion/Accordion.d.ts +1 -4
- package/dist/es/{types → src}/components/BannerNotification/BannerNotification.d.ts +1 -4
- package/dist/es/{types → src}/components/Breadcrumbs/Breadcrumbs.d.ts +1 -4
- package/dist/{cjs/types → es/src}/components/Button/Button.d.ts +1 -4
- package/dist/es/{types → src}/components/Chip/Chip.d.ts +2 -5
- package/dist/es/{types → src}/components/Datatable/Datatable.d.ts +1 -1
- package/dist/es/{types → src}/components/Datatable/datatable.interface.d.ts +5 -4
- package/dist/{cjs/types → es/src}/components/EmbbededNotification/EmbeddedNotification.d.ts +1 -4
- package/dist/es/{types → src}/components/Form/AutoCompleteMulti/AutoCompleteMulti.d.ts +7 -6
- package/dist/{cjs/types → es/src}/components/Form/AutoCompleteSingle/AutoCompleteSingle.d.ts +4 -6
- package/dist/{cjs/types → es/src}/components/Form/Checkbox/Checkbox.d.ts +4 -7
- package/dist/es/src/components/Form/CheckboxGroup/CheckboxGroup.d.ts +12 -0
- package/dist/es/src/components/Form/CheckboxGroup/checkboxgroup.interface.d.ts +8 -0
- package/dist/{cjs/types → es/src}/components/Form/DatePicker/DatePicker.d.ts +1 -1
- package/dist/es/{types → src}/components/Form/MultiSelect/MultiSelect.d.ts +4 -7
- package/dist/{cjs/types → es/src}/components/Form/RadioGroup/RadioGroup.d.ts +2 -5
- package/dist/es/src/components/Form/Select/Select.d.ts +22 -0
- package/dist/{cjs/types → es/src}/components/Form/Switch/Switch.d.ts +1 -4
- package/dist/es/{types → src}/components/Form/TextField/TextField.d.ts +5 -6
- package/dist/es/src/components/Form/TimePicker/TimePicker.d.ts +20 -0
- package/dist/es/src/components/Form/TimePicker/index.d.ts +1 -0
- package/dist/es/src/components/IconButton/IconButton.d.ts +17 -0
- package/dist/{cjs/types → es/src}/components/IconProvider/IconProvider.d.ts +1 -4
- package/dist/es/{types → src}/components/Link/Link.d.ts +1 -4
- package/dist/es/src/components/MenuItem/MenuItem.d.ts +10 -0
- package/dist/es/{types → src}/components/Modal/Dialog/Dialog.d.ts +1 -1
- package/dist/es/{types → src}/components/Modal/Drawer/Drawer.d.ts +1 -1
- package/dist/{cjs/types → es/src}/components/Navigation/Stepper/Step.d.ts +1 -1
- package/dist/{cjs/types → es/src}/components/Navigation/Stepper/Stepper.d.ts +1 -1
- package/dist/es/src/components/Pagination/Pagination.d.ts +13 -0
- package/dist/{cjs/types → es/src}/components/Snackbar/Snackbar.d.ts +1 -4
- package/dist/{cjs/types → es/src}/components/Text/Text.d.ts +1 -4
- package/dist/es/src/components/Tooltip/Tooltip.d.ts +11 -0
- package/dist/{cjs/types → es/src}/components/UploadDocument/FileUploaderSingle.d.ts +10 -11
- package/dist/es/src/components/UploadDocument/fileuploadersingle.interface.d.ts +5 -0
- package/dist/{cjs/types → es/src}/components/index.d.ts +2 -0
- package/dist/{cjs/types → es/src}/helpers/GooglePickerWrapper.d.ts +2 -1
- package/dist/es/src/hooks/useGooleDrivePicker.d.ts +4 -0
- package/dist/es/src/index.d.ts +4 -0
- package/package.json +30 -35
- package/src/DesignSystemProvider.tsx +2 -1
- package/src/components/Accordion/Accordion.tsx +4 -4
- package/src/components/BannerNotification/BannerNotification.tsx +1 -3
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +2 -4
- package/src/components/Button/Button.tsx +0 -2
- package/src/components/Chip/Chip.tsx +2 -4
- package/src/components/Datatable/Datatable.tsx +31 -9
- package/src/components/Datatable/DatatableCellRender.tsx +4 -3
- package/src/components/Datatable/datatable.interface.ts +5 -4
- package/src/components/Datatable/use-pagination-props.hook.ts +2 -2
- package/src/components/EmbbededNotification/EmbeddedNotification.tsx +2 -4
- package/src/components/Form/AutoCompleteMulti/AutoCompleteMulti.tsx +37 -12
- package/src/components/Form/AutoCompleteSingle/AutoCompleteSingle.tsx +28 -11
- package/src/components/Form/Checkbox/Checkbox.tsx +24 -27
- package/src/components/Form/CheckboxGroup/CheckboxGroup.tsx +9 -26
- package/src/components/Form/CheckboxGroup/checkboxgroup.interface.ts +22 -0
- package/src/components/Form/DatePicker/DatePicker.tsx +16 -4
- package/src/components/Form/MultiSelect/MultiSelect.tsx +43 -14
- package/src/components/Form/RadioGroup/RadioGroup.tsx +20 -25
- package/src/components/Form/Select/Select.tsx +49 -12
- package/src/components/Form/Switch/Switch.tsx +0 -2
- package/src/components/Form/TextField/TextField.tsx +121 -108
- package/src/components/Form/TimePicker/TimePicker.tsx +228 -0
- package/src/components/Form/TimePicker/index.ts +1 -0
- package/src/components/IconButton/IconButton.tsx +15 -9
- package/src/components/IconProvider/IconProvider.tsx +3 -4
- package/src/components/Link/Link.tsx +0 -2
- package/src/components/MenuItem/MenuItem.tsx +10 -39
- package/src/components/Modal/Dialog/Dialog.tsx +7 -4
- package/src/components/Modal/Drawer/Drawer.tsx +2 -2
- package/src/components/Navigation/Stepper/Step.tsx +4 -3
- package/src/components/Navigation/Stepper/Stepper.tsx +1 -1
- package/src/components/NotistackAdapter/NotistackAdapter.tsx +1 -1
- package/src/components/Pagination/Pagination.tsx +9 -14
- package/src/components/Snackbar/Snackbar.tsx +1 -3
- package/src/components/Text/Text.tsx +0 -2
- package/src/components/Tooltip/Tooltip.tsx +41 -32
- package/src/components/UploadDocument/FileUploaderSingle.tsx +97 -55
- package/src/components/UploadDocument/fileuploadersingle.interface.ts +5 -0
- package/src/components/index.ts +2 -0
- package/src/helpers/GooglePickerWrapper.tsx +3 -3
- package/src/hooks/useGooleDrivePicker.ts +10 -8
- package/src/index.ts +3 -5
- package/src/types/global.d.ts +6 -4
- package/src/types/googleDrive.ts +1 -0
- package/dist/cjs/types/components/BannerNotification/BannerNotification.d.ts +0 -11
- package/dist/cjs/types/components/Breadcrumbs/Breadcrumbs.d.ts +0 -15
- package/dist/cjs/types/components/Chip/Chip.d.ts +0 -19
- package/dist/cjs/types/components/Datatable/Datatable.d.ts +0 -4
- package/dist/cjs/types/components/Datatable/datatable.interface.d.ts +0 -53
- package/dist/cjs/types/components/Form/AutoCompleteMulti/AutoCompleteMulti.d.ts +0 -18
- package/dist/cjs/types/components/Form/CheckboxGroup/CheckboxGroup.d.ts +0 -20
- package/dist/cjs/types/components/Form/MultiSelect/MultiSelect.d.ts +0 -23
- package/dist/cjs/types/components/Form/Select/Select.d.ts +0 -22
- package/dist/cjs/types/components/Form/TextField/TextField.d.ts +0 -21
- package/dist/cjs/types/components/IconButton/IconButton.d.ts +0 -19
- package/dist/cjs/types/components/Link/Link.d.ts +0 -11
- package/dist/cjs/types/components/MenuItem/MenuItem.d.ts +0 -13
- package/dist/cjs/types/components/Modal/Dialog/Dialog.d.ts +0 -4
- package/dist/cjs/types/components/Modal/Drawer/Drawer.d.ts +0 -4
- package/dist/cjs/types/components/Pagination/Pagination.d.ts +0 -16
- package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +0 -13
- package/dist/cjs/types/helpers/dataGetValue.d.ts +0 -2
- package/dist/cjs/types/hooks/useGooleDrivePicker.d.ts +0 -4
- package/dist/cjs/types/index.d.ts +0 -2
- package/dist/es/index.mjs +0 -106
- package/dist/es/index.mjs.map +0 -1
- package/dist/es/types/DesignSystemProvider.d.ts +0 -13
- package/dist/es/types/components/Accordion/Accordion.d.ts +0 -15
- package/dist/es/types/components/Accordion/index.d.ts +0 -1
- package/dist/es/types/components/BannerNotification/index.d.ts +0 -1
- package/dist/es/types/components/Breadcrumbs/index.d.ts +0 -1
- package/dist/es/types/components/Button/Button.d.ts +0 -11
- package/dist/es/types/components/Button/index.d.ts +0 -1
- package/dist/es/types/components/Chip/index.d.ts +0 -1
- package/dist/es/types/components/Datatable/DatatableCellRender.d.ts +0 -4
- package/dist/es/types/components/Datatable/index.d.ts +0 -1
- package/dist/es/types/components/Datatable/use-pagination-props.hook.d.ts +0 -3
- package/dist/es/types/components/EmbbededNotification/EmbeddedNotification.d.ts +0 -13
- package/dist/es/types/components/EmbbededNotification/index.d.ts +0 -1
- package/dist/es/types/components/Form/AutoCompleteMulti/index.d.ts +0 -1
- package/dist/es/types/components/Form/AutoCompleteSingle/AutoCompleteSingle.d.ts +0 -19
- package/dist/es/types/components/Form/AutoCompleteSingle/index.d.ts +0 -1
- package/dist/es/types/components/Form/Checkbox/Checkbox.d.ts +0 -17
- package/dist/es/types/components/Form/Checkbox/index.d.ts +0 -1
- package/dist/es/types/components/Form/CheckboxGroup/CheckboxGroup.d.ts +0 -20
- package/dist/es/types/components/Form/CheckboxGroup/index.d.ts +0 -1
- package/dist/es/types/components/Form/DatePicker/DatePicker.d.ts +0 -15
- package/dist/es/types/components/Form/DatePicker/index.d.ts +0 -1
- package/dist/es/types/components/Form/MultiSelect/index.d.ts +0 -1
- package/dist/es/types/components/Form/RadioGroup/RadioGroup.d.ts +0 -21
- package/dist/es/types/components/Form/RadioGroup/index.d.ts +0 -1
- package/dist/es/types/components/Form/Select/Select.d.ts +0 -22
- package/dist/es/types/components/Form/Select/index.d.ts +0 -1
- package/dist/es/types/components/Form/Switch/Switch.d.ts +0 -13
- package/dist/es/types/components/Form/Switch/index.d.ts +0 -1
- package/dist/es/types/components/Form/TextField/index.d.ts +0 -1
- package/dist/es/types/components/IconButton/IconButton.d.ts +0 -19
- package/dist/es/types/components/IconButton/index.d.ts +0 -1
- package/dist/es/types/components/IconProvider/IconProvider.d.ts +0 -22
- package/dist/es/types/components/IconProvider/index.d.ts +0 -1
- package/dist/es/types/components/Link/index.d.ts +0 -1
- package/dist/es/types/components/MenuItem/MenuItem.d.ts +0 -13
- package/dist/es/types/components/MenuItem/index.d.ts +0 -1
- package/dist/es/types/components/Modal/Dialog/index.d.ts +0 -1
- package/dist/es/types/components/Modal/Drawer/index.d.ts +0 -1
- package/dist/es/types/components/Modal/modal.interface.d.ts +0 -24
- package/dist/es/types/components/Navigation/Stepper/Step.d.ts +0 -7
- package/dist/es/types/components/Navigation/Stepper/Stepper.d.ts +0 -11
- package/dist/es/types/components/Navigation/Stepper/index.d.ts +0 -1
- package/dist/es/types/components/Navigation/Stepper/stepper.helper.d.ts +0 -2
- package/dist/es/types/components/Navigation/Stepper/stepper.interface.d.ts +0 -12
- package/dist/es/types/components/NotistackAdapter/NotistackAdapter.d.ts +0 -4
- package/dist/es/types/components/NotistackAdapter/index.d.ts +0 -1
- package/dist/es/types/components/Pagination/Pagination.d.ts +0 -16
- package/dist/es/types/components/Pagination/index.d.ts +0 -1
- package/dist/es/types/components/Pagination/pagination.helper.d.ts +0 -1
- package/dist/es/types/components/Snackbar/Snackbar.d.ts +0 -11
- package/dist/es/types/components/Snackbar/index.d.ts +0 -1
- package/dist/es/types/components/Text/Text.d.ts +0 -11
- package/dist/es/types/components/Text/index.d.ts +0 -1
- package/dist/es/types/components/Tooltip/Tooltip.d.ts +0 -13
- package/dist/es/types/components/Tooltip/index.d.ts +0 -1
- package/dist/es/types/components/Tooltip/tooltip.interface.d.ts +0 -1
- package/dist/es/types/components/UploadDocument/FileUploaderSingle.d.ts +0 -78
- package/dist/es/types/components/UploadDocument/index.d.ts +0 -1
- package/dist/es/types/components/index.d.ts +0 -31
- package/dist/es/types/helpers/GooglePickerWrapper.d.ts +0 -13
- package/dist/es/types/helpers/dataGetValue.d.ts +0 -2
- package/dist/es/types/hooks/useGooleDrivePicker.d.ts +0 -4
- package/dist/es/types/index.d.ts +0 -2
- package/dist/es/types/types/googleDrive.d.ts +0 -133
- package/src/helpers/dataGetValue.ts +0 -22
- /package/dist/{cjs/types → es/src}/DesignSystemProvider.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Accordion/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/BannerNotification/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Breadcrumbs/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Button/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Chip/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Datatable/DatatableCellRender.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Datatable/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Datatable/use-pagination-props.hook.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/EmbbededNotification/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/AutoCompleteMulti/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/AutoCompleteSingle/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/Checkbox/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/CheckboxGroup/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/DatePicker/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/MultiSelect/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/RadioGroup/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/Select/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/Switch/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Form/TextField/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/IconButton/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/IconProvider/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Link/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/MenuItem/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Modal/Dialog/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Modal/Drawer/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Modal/modal.interface.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Navigation/Stepper/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Navigation/Stepper/stepper.helper.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Navigation/Stepper/stepper.interface.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/NotistackAdapter/NotistackAdapter.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/NotistackAdapter/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Pagination/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Pagination/pagination.helper.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Snackbar/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Text/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Tooltip/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/Tooltip/tooltip.interface.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/components/UploadDocument/index.d.ts +0 -0
- /package/dist/{cjs/types → es/src}/types/googleDrive.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { ReactNode, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import { faInfoCircle } from '@fortawesome/pro-solid-svg-icons';
|
|
4
4
|
import { CheckboxStyle } from '@groupeactual/design-tokens';
|
|
@@ -9,22 +9,22 @@ import {
|
|
|
9
9
|
FormControl,
|
|
10
10
|
FormControlLabel,
|
|
11
11
|
FormHelperText,
|
|
12
|
-
Typography,
|
|
13
12
|
styled,
|
|
14
13
|
useTheme,
|
|
15
14
|
} from '@mui/material';
|
|
16
15
|
|
|
17
|
-
import IconProvider from '
|
|
18
|
-
import
|
|
16
|
+
import IconProvider from '@/components/IconProvider';
|
|
17
|
+
import Text from '@/components/Text';
|
|
18
|
+
import Tooltip from '@/components/Tooltip';
|
|
19
19
|
|
|
20
20
|
interface Props {
|
|
21
21
|
name: string;
|
|
22
22
|
value: boolean;
|
|
23
|
-
label:
|
|
23
|
+
label: ReactNode;
|
|
24
24
|
onChange?: (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
_field: string,
|
|
26
|
+
_value: boolean,
|
|
27
|
+
_shouldValidate?: boolean | undefined,
|
|
28
28
|
) => void;
|
|
29
29
|
helperText?: string;
|
|
30
30
|
error?: string;
|
|
@@ -97,25 +97,24 @@ const Checkbox = ({
|
|
|
97
97
|
</Box>
|
|
98
98
|
}
|
|
99
99
|
label={
|
|
100
|
-
<Box
|
|
101
|
-
<
|
|
100
|
+
<Box>
|
|
101
|
+
<Text
|
|
102
|
+
component="span"
|
|
103
|
+
variant="body1"
|
|
104
|
+
className={getLabelClassName}
|
|
105
|
+
>
|
|
102
106
|
{label}
|
|
103
|
-
</
|
|
107
|
+
</Text>
|
|
104
108
|
{infoBubbleContent && (
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
color="#1d91c3"
|
|
115
|
-
/>
|
|
116
|
-
</Box>
|
|
117
|
-
</Tooltip>
|
|
118
|
-
</Box>
|
|
109
|
+
<Tooltip
|
|
110
|
+
title={infoBubbleContent}
|
|
111
|
+
placement={infoBubblePosition}
|
|
112
|
+
sx={{
|
|
113
|
+
ml: '6px',
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<IconProvider icon={faInfoCircle} size="sm" color="blueInfo" />
|
|
117
|
+
</Tooltip>
|
|
119
118
|
)}
|
|
120
119
|
</Box>
|
|
121
120
|
}
|
|
@@ -129,6 +128,4 @@ const Checkbox = ({
|
|
|
129
128
|
);
|
|
130
129
|
};
|
|
131
130
|
|
|
132
|
-
Checkbox.displayName = 'Checkbox';
|
|
133
|
-
|
|
134
131
|
export default Checkbox;
|
|
@@ -10,35 +10,17 @@ import {
|
|
|
10
10
|
useTheme,
|
|
11
11
|
} from '@mui/material';
|
|
12
12
|
|
|
13
|
-
import Checkbox from '
|
|
13
|
+
import Checkbox from '@/components/Form/Checkbox';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
label: string;
|
|
17
|
-
value: boolean;
|
|
18
|
-
name: string;
|
|
19
|
-
infoBubbleContent?: string;
|
|
20
|
-
infoBubblePosition?:
|
|
21
|
-
| 'right'
|
|
22
|
-
| 'bottom'
|
|
23
|
-
| 'left'
|
|
24
|
-
| 'top'
|
|
25
|
-
| 'bottom-end'
|
|
26
|
-
| 'bottom-start'
|
|
27
|
-
| 'left-end'
|
|
28
|
-
| 'left-start'
|
|
29
|
-
| 'right-end'
|
|
30
|
-
| 'right-start'
|
|
31
|
-
| 'top-end'
|
|
32
|
-
| 'top-start'
|
|
33
|
-
| undefined;
|
|
34
|
-
}
|
|
15
|
+
import { CheckboxItemType } from './checkboxgroup.interface';
|
|
35
16
|
|
|
36
17
|
interface CheckboxGroupProps {
|
|
37
18
|
label: string;
|
|
38
|
-
options:
|
|
19
|
+
options: CheckboxItemType[];
|
|
39
20
|
disabled?: boolean;
|
|
40
21
|
error?: string;
|
|
41
22
|
helperText?: string;
|
|
23
|
+
onChange?: (_selectedOptions: Record<string, boolean>) => void;
|
|
42
24
|
}
|
|
43
25
|
|
|
44
26
|
const CheckboxGroup = ({
|
|
@@ -47,6 +29,7 @@ const CheckboxGroup = ({
|
|
|
47
29
|
disabled,
|
|
48
30
|
error,
|
|
49
31
|
helperText,
|
|
32
|
+
onChange,
|
|
50
33
|
}: CheckboxGroupProps) => {
|
|
51
34
|
const theme = useTheme();
|
|
52
35
|
const StyledCheckboxGroupForm = useMemo(
|
|
@@ -56,10 +39,12 @@ const CheckboxGroup = ({
|
|
|
56
39
|
const [selectedOptions, setSelectedOptions] = useState({});
|
|
57
40
|
|
|
58
41
|
const handleChange = (label: string, isChecked: boolean) => {
|
|
59
|
-
|
|
42
|
+
const updatedOptions = {
|
|
60
43
|
...selectedOptions,
|
|
61
44
|
[label]: isChecked,
|
|
62
|
-
}
|
|
45
|
+
};
|
|
46
|
+
setSelectedOptions(updatedOptions);
|
|
47
|
+
onChange?.(updatedOptions);
|
|
63
48
|
};
|
|
64
49
|
|
|
65
50
|
const getLegendClassName = useMemo(() => {
|
|
@@ -97,6 +82,4 @@ const CheckboxGroup = ({
|
|
|
97
82
|
);
|
|
98
83
|
};
|
|
99
84
|
|
|
100
|
-
CheckboxGroup.displayName = 'CheckboxGroup';
|
|
101
|
-
|
|
102
85
|
export default CheckboxGroup;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CheckboxItemType {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: boolean;
|
|
6
|
+
name: string;
|
|
7
|
+
infoBubbleContent?: string;
|
|
8
|
+
infoBubblePosition?:
|
|
9
|
+
| 'right'
|
|
10
|
+
| 'bottom'
|
|
11
|
+
| 'left'
|
|
12
|
+
| 'top'
|
|
13
|
+
| 'bottom-end'
|
|
14
|
+
| 'bottom-start'
|
|
15
|
+
| 'left-end'
|
|
16
|
+
| 'left-start'
|
|
17
|
+
| 'right-end'
|
|
18
|
+
| 'right-start'
|
|
19
|
+
| 'top-end'
|
|
20
|
+
| 'top-start'
|
|
21
|
+
| undefined;
|
|
22
|
+
}
|
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
faAngleLeft,
|
|
5
5
|
faAngleRight,
|
|
6
6
|
faCalendarDay,
|
|
7
|
+
faCheck,
|
|
7
8
|
} from '@fortawesome/pro-regular-svg-icons';
|
|
8
|
-
import { faCaretDown
|
|
9
|
+
import { faCaretDown } from '@fortawesome/pro-solid-svg-icons';
|
|
9
10
|
import { DatePickerStyle } from '@groupeactual/design-tokens';
|
|
10
11
|
import {
|
|
11
12
|
Box,
|
|
@@ -24,12 +25,12 @@ import { enUS, frFR } from '@mui/x-date-pickers/locales';
|
|
|
24
25
|
import { Dayjs } from 'dayjs';
|
|
25
26
|
import 'dayjs/locale/fr';
|
|
26
27
|
|
|
27
|
-
import IconProvider from '
|
|
28
|
+
import IconProvider from '@/components/IconProvider';
|
|
28
29
|
|
|
29
30
|
interface Props<T extends Dayjs>
|
|
30
31
|
extends Omit<DatePickerProps<T>, 'onChange' | 'width'> {
|
|
31
32
|
value: T | null | undefined;
|
|
32
|
-
onChange: (
|
|
33
|
+
onChange: (_value: T | null | undefined) => void;
|
|
33
34
|
error?: string;
|
|
34
35
|
success?: boolean;
|
|
35
36
|
helperText?: string;
|
|
@@ -114,6 +115,11 @@ const DatePicker = <T extends Dayjs>({
|
|
|
114
115
|
),
|
|
115
116
|
}}
|
|
116
117
|
slotProps={{
|
|
118
|
+
desktopPaper: {
|
|
119
|
+
sx: {
|
|
120
|
+
boxShadow: '0px 2px 10px 0px #2727271F',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
117
123
|
textField: {
|
|
118
124
|
variant: 'outlined',
|
|
119
125
|
error: !!error,
|
|
@@ -133,7 +139,13 @@ const DatePicker = <T extends Dayjs>({
|
|
|
133
139
|
},
|
|
134
140
|
clearButton: {
|
|
135
141
|
disableRipple: true,
|
|
136
|
-
sx: {
|
|
142
|
+
sx: {
|
|
143
|
+
px: 0,
|
|
144
|
+
'.MuiSvgIcon-root': {
|
|
145
|
+
width: 18,
|
|
146
|
+
height: 18,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
137
149
|
},
|
|
138
150
|
}}
|
|
139
151
|
{...props}
|
|
@@ -3,9 +3,9 @@ import React, { FocusEventHandler, useMemo, useRef } from 'react';
|
|
|
3
3
|
import {
|
|
4
4
|
faCheck,
|
|
5
5
|
faChevronDown,
|
|
6
|
-
faCircleX,
|
|
7
6
|
faTimes,
|
|
8
|
-
} from '@fortawesome/pro-
|
|
7
|
+
} from '@fortawesome/pro-regular-svg-icons';
|
|
8
|
+
import { faCircleX } from '@fortawesome/pro-solid-svg-icons';
|
|
9
9
|
import { SelectStyle } from '@groupeactual/design-tokens';
|
|
10
10
|
import {
|
|
11
11
|
Box,
|
|
@@ -20,8 +20,8 @@ import {
|
|
|
20
20
|
useTheme,
|
|
21
21
|
} from '@mui/material';
|
|
22
22
|
|
|
23
|
-
import Chip from '
|
|
24
|
-
import IconProvider from '
|
|
23
|
+
import Chip from '@/components/Chip';
|
|
24
|
+
import IconProvider from '@/components/IconProvider';
|
|
25
25
|
|
|
26
26
|
interface Props<T>
|
|
27
27
|
extends Omit<
|
|
@@ -41,16 +41,16 @@ interface Props<T>
|
|
|
41
41
|
onBlur?:
|
|
42
42
|
| FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>
|
|
43
43
|
| undefined;
|
|
44
|
-
onChange: (
|
|
45
|
-
getRenderValue: (
|
|
46
|
-
getKeyValue: (
|
|
44
|
+
onChange: (_value: T[]) => void;
|
|
45
|
+
getRenderValue: (_option: T) => string;
|
|
46
|
+
getKeyValue: (_option: T) => string;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const MenuProps = {
|
|
50
50
|
disableAutoFocusItem: true,
|
|
51
51
|
PaperProps: {
|
|
52
52
|
sx: {
|
|
53
|
-
boxShadow: '0px 2px 10px 0px',
|
|
53
|
+
boxShadow: '0px 2px 10px 0px #2727271F',
|
|
54
54
|
width: 0,
|
|
55
55
|
},
|
|
56
56
|
},
|
|
@@ -76,6 +76,7 @@ const MultiSelect = <T,>({
|
|
|
76
76
|
() => styled(FormControl)(SelectStyle(theme)),
|
|
77
77
|
[theme],
|
|
78
78
|
);
|
|
79
|
+
const [isOpened, setIsOpened] = React.useState(props.open ?? false);
|
|
79
80
|
|
|
80
81
|
const handleChange = (event: SelectChangeEvent<typeof options>) =>
|
|
81
82
|
onChange?.(event.target.value as T[]);
|
|
@@ -179,8 +180,16 @@ const MultiSelect = <T,>({
|
|
|
179
180
|
<IconProvider
|
|
180
181
|
className={disabled ? 'Mui-disabled SelectIcon' : 'SelectIcon'}
|
|
181
182
|
icon={color === 'success' ? faCheck : faChevronDown}
|
|
182
|
-
size=
|
|
183
|
+
size="md"
|
|
184
|
+
onClick={() => {
|
|
185
|
+
if (!disabled) {
|
|
186
|
+
setIsOpened(!isOpened);
|
|
187
|
+
}
|
|
188
|
+
}}
|
|
183
189
|
sx={{
|
|
190
|
+
':hover': {
|
|
191
|
+
cursor: disabled ? 'auto' : 'pointer',
|
|
192
|
+
},
|
|
184
193
|
transform:
|
|
185
194
|
className.toString().includes('iconOpen') &&
|
|
186
195
|
color !== 'success'
|
|
@@ -191,12 +200,37 @@ const MultiSelect = <T,>({
|
|
|
191
200
|
)}
|
|
192
201
|
MenuProps={MenuProps}
|
|
193
202
|
{...props}
|
|
203
|
+
open={isOpened}
|
|
204
|
+
onClose={(e) => {
|
|
205
|
+
if (!disabled) {
|
|
206
|
+
if (props.onClose) {
|
|
207
|
+
props.onClose(e);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
setIsOpened(false);
|
|
211
|
+
}
|
|
212
|
+
}}
|
|
213
|
+
onOpen={(e) => {
|
|
214
|
+
if (!disabled) {
|
|
215
|
+
if (props.onOpen) {
|
|
216
|
+
props.onOpen(e);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
setIsOpened(true);
|
|
220
|
+
}
|
|
221
|
+
}}
|
|
194
222
|
>
|
|
195
223
|
{options?.map((option) => (
|
|
196
224
|
<MenuItem
|
|
197
225
|
key={getKeyValue(option)}
|
|
198
226
|
value={option as never}
|
|
199
227
|
sx={{
|
|
228
|
+
'&:hover': {
|
|
229
|
+
backgroundColor: theme.palette['blueHoverEquivalence'],
|
|
230
|
+
},
|
|
231
|
+
'&.Mui-selected': {
|
|
232
|
+
backgroundColor: theme.palette['greyXLight'] + ' !important',
|
|
233
|
+
},
|
|
200
234
|
fontSize: 14,
|
|
201
235
|
fontWeight: value.indexOf(option) === -1 ? 400 : 500,
|
|
202
236
|
whiteSpace: 'normal',
|
|
@@ -205,9 +239,6 @@ const MultiSelect = <T,>({
|
|
|
205
239
|
maxWidth: '100%',
|
|
206
240
|
backgroundColor:
|
|
207
241
|
value.indexOf(option) === -1 ? 'white' : 'greyXLight',
|
|
208
|
-
'&:hover': {
|
|
209
|
-
backgroundColor: 'blueHoverEquivalence',
|
|
210
|
-
},
|
|
211
242
|
}}
|
|
212
243
|
>
|
|
213
244
|
{getRenderValue(option)}
|
|
@@ -224,6 +255,4 @@ const MultiSelect = <T,>({
|
|
|
224
255
|
);
|
|
225
256
|
};
|
|
226
257
|
|
|
227
|
-
MultiSelect.displayName = 'MultiSelect';
|
|
228
|
-
|
|
229
258
|
export default MultiSelect;
|
|
@@ -15,8 +15,9 @@ import {
|
|
|
15
15
|
useTheme,
|
|
16
16
|
} from '@mui/material';
|
|
17
17
|
|
|
18
|
-
import IconProvider from '
|
|
19
|
-
import
|
|
18
|
+
import IconProvider from '@/components/IconProvider';
|
|
19
|
+
import Text from '@/components/Text';
|
|
20
|
+
import Tooltip from '@/components/Tooltip';
|
|
20
21
|
|
|
21
22
|
interface ItemType<T> {
|
|
22
23
|
label: string;
|
|
@@ -41,7 +42,7 @@ interface ItemType<T> {
|
|
|
41
42
|
interface Props<T> extends Omit<RadioGroupProps, 'onChange'> {
|
|
42
43
|
label: string;
|
|
43
44
|
options: ItemType<T>[];
|
|
44
|
-
onChange: (
|
|
45
|
+
onChange: (_value: T) => void;
|
|
45
46
|
error?: string;
|
|
46
47
|
helperText?: string;
|
|
47
48
|
disabled?: boolean;
|
|
@@ -93,28 +94,24 @@ const RadioGroup = <T,>({
|
|
|
93
94
|
control={<MUIRadio size="small" />}
|
|
94
95
|
value={value}
|
|
95
96
|
label={
|
|
96
|
-
<Box
|
|
97
|
-
|
|
97
|
+
<Box>
|
|
98
|
+
<Text component="span" variant="body1">
|
|
99
|
+
{label}
|
|
100
|
+
</Text>
|
|
98
101
|
{infoBubbleContent && (
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
alignItems="center"
|
|
102
|
+
<Tooltip
|
|
103
|
+
title={infoBubbleContent}
|
|
104
|
+
placement={infoBubblePosition}
|
|
105
|
+
sx={{
|
|
106
|
+
ml: '6px',
|
|
107
|
+
}}
|
|
106
108
|
>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
size="sm"
|
|
114
|
-
color="#1d91c3"
|
|
115
|
-
/>
|
|
116
|
-
</Tooltip>
|
|
117
|
-
</Box>
|
|
109
|
+
<IconProvider
|
|
110
|
+
icon={faInfoCircle}
|
|
111
|
+
size="sm"
|
|
112
|
+
color="blueInfo"
|
|
113
|
+
/>
|
|
114
|
+
</Tooltip>
|
|
118
115
|
)}
|
|
119
116
|
</Box>
|
|
120
117
|
}
|
|
@@ -131,6 +128,4 @@ const RadioGroup = <T,>({
|
|
|
131
128
|
);
|
|
132
129
|
};
|
|
133
130
|
|
|
134
|
-
RadioGroup.displayName = 'RadioGroup';
|
|
135
|
-
|
|
136
131
|
export default RadioGroup;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { BaseSyntheticEvent, useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
4
|
+
import { faCheck, faChevronDown } from '@fortawesome/pro-regular-svg-icons';
|
|
4
5
|
import { SelectStyle } from '@groupeactual/design-tokens';
|
|
5
6
|
import {
|
|
6
7
|
Box,
|
|
@@ -15,30 +16,32 @@ import {
|
|
|
15
16
|
useTheme,
|
|
16
17
|
} from '@mui/material';
|
|
17
18
|
|
|
18
|
-
import
|
|
19
|
+
import IconProvider from '@/components/IconProvider';
|
|
19
20
|
|
|
20
21
|
interface Props<T>
|
|
21
22
|
extends Omit<SelectProps<T>, 'value' | 'onChange' | 'color' | 'error'> {
|
|
22
23
|
options: T[];
|
|
23
24
|
placeholder?: string;
|
|
24
25
|
disabled?: boolean;
|
|
25
|
-
label
|
|
26
|
+
label?: string;
|
|
26
27
|
helperText?: string;
|
|
27
28
|
color?: 'success';
|
|
28
29
|
value: T | undefined;
|
|
29
30
|
width?: number | string;
|
|
30
31
|
error?: string;
|
|
31
32
|
className?: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
popupIcon?: IconDefinition;
|
|
34
|
+
getRenderValue: (_option: T) => string;
|
|
35
|
+
onChange: (_value: T) => void;
|
|
36
|
+
onBlur?: (_event: BaseSyntheticEvent) => void;
|
|
37
|
+
onClick?: (_event: BaseSyntheticEvent) => void;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
const MenuProps = {
|
|
38
41
|
disableAutoFocusItem: true,
|
|
39
42
|
PaperProps: {
|
|
40
43
|
sx: {
|
|
41
|
-
boxShadow: '0px 2px 10px 0px',
|
|
44
|
+
boxShadow: '0px 2px 10px 0px #2727271F',
|
|
42
45
|
width: 0,
|
|
43
46
|
},
|
|
44
47
|
},
|
|
@@ -54,6 +57,7 @@ const Select = <T,>({
|
|
|
54
57
|
helperText,
|
|
55
58
|
width = '100%',
|
|
56
59
|
disabled,
|
|
60
|
+
popupIcon = faChevronDown,
|
|
57
61
|
onChange,
|
|
58
62
|
getRenderValue,
|
|
59
63
|
...props
|
|
@@ -64,6 +68,8 @@ const Select = <T,>({
|
|
|
64
68
|
[theme],
|
|
65
69
|
);
|
|
66
70
|
|
|
71
|
+
const [isOpened, setIsOpened] = React.useState(props.open ?? false);
|
|
72
|
+
|
|
67
73
|
const handleChange = (event: SelectChangeEvent<T>) =>
|
|
68
74
|
onChange?.(event.target.value as T);
|
|
69
75
|
|
|
@@ -109,11 +115,19 @@ const Select = <T,>({
|
|
|
109
115
|
notched={(placeholder && true) || undefined}
|
|
110
116
|
onChange={handleChange}
|
|
111
117
|
IconComponent={({ className }) => (
|
|
112
|
-
<
|
|
118
|
+
<IconProvider
|
|
113
119
|
className={disabled ? 'Mui-disabled SelectIcon' : 'SelectIcon'}
|
|
114
|
-
icon={color === 'success' ? faCheck :
|
|
115
|
-
|
|
120
|
+
icon={color === 'success' ? faCheck : popupIcon}
|
|
121
|
+
onClick={() => {
|
|
122
|
+
if (!disabled) {
|
|
123
|
+
setIsOpened(!isOpened);
|
|
124
|
+
}
|
|
125
|
+
}}
|
|
126
|
+
size="md"
|
|
116
127
|
sx={{
|
|
128
|
+
':hover': {
|
|
129
|
+
cursor: disabled ? 'auto' : 'pointer',
|
|
130
|
+
},
|
|
117
131
|
marginTop: color === 'success' ? '2px' : '0px',
|
|
118
132
|
transform:
|
|
119
133
|
className.toString().includes('iconOpen') &&
|
|
@@ -126,10 +140,35 @@ const Select = <T,>({
|
|
|
126
140
|
MenuProps={MenuProps}
|
|
127
141
|
renderValue={(value) => getRenderValue(value)}
|
|
128
142
|
{...props}
|
|
143
|
+
open={isOpened}
|
|
144
|
+
onClose={(e) => {
|
|
145
|
+
if (!disabled) {
|
|
146
|
+
if (props.onClose) {
|
|
147
|
+
props.onClose(e);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
setIsOpened(false);
|
|
151
|
+
}
|
|
152
|
+
}}
|
|
153
|
+
onOpen={(e) => {
|
|
154
|
+
if (!disabled) {
|
|
155
|
+
if (props.onOpen) {
|
|
156
|
+
props.onOpen(e);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
setIsOpened(true);
|
|
160
|
+
}
|
|
161
|
+
}}
|
|
129
162
|
>
|
|
130
163
|
{options?.map((option, i) => (
|
|
131
164
|
<MenuItem
|
|
132
165
|
sx={{
|
|
166
|
+
'&:hover': {
|
|
167
|
+
backgroundColor: theme.palette['blueHoverEquivalence'],
|
|
168
|
+
},
|
|
169
|
+
'&.Mui-selected': {
|
|
170
|
+
backgroundColor: theme.palette['greyXLight'] + ' !important',
|
|
171
|
+
},
|
|
133
172
|
fontSize: 14,
|
|
134
173
|
fontWeight: value === option ? 500 : 400,
|
|
135
174
|
whiteSpace: 'normal',
|
|
@@ -165,6 +204,4 @@ const Select = <T,>({
|
|
|
165
204
|
);
|
|
166
205
|
};
|
|
167
206
|
|
|
168
|
-
Select.displayName = 'Select';
|
|
169
|
-
|
|
170
207
|
export default Select;
|