@groupeactual/ui-kit 1.7.0-beta.0 → 1.7.0-beta.4

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.
Files changed (84) hide show
  1. package/dist/cjs/index.js +9 -9
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/es/index.d.ts +176 -163
  4. package/dist/es/index.js +8 -18
  5. package/dist/es/index.js.map +1 -1
  6. package/dist/es/src/components/Accordion/Accordion.d.ts +1 -4
  7. package/dist/es/src/components/BannerNotification/BannerNotification.d.ts +1 -4
  8. package/dist/es/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -4
  9. package/dist/es/src/components/Button/Button.d.ts +1 -4
  10. package/dist/es/src/components/Chip/Chip.d.ts +2 -5
  11. package/dist/es/src/components/Datatable/Datatable.d.ts +1 -1
  12. package/dist/es/src/components/Datatable/datatable.interface.d.ts +5 -4
  13. package/dist/es/src/components/EmbbededNotification/EmbeddedNotification.d.ts +1 -4
  14. package/dist/es/src/components/Form/AutoCompleteMulti/AutoCompleteMulti.d.ts +7 -6
  15. package/dist/es/src/components/Form/AutoCompleteSingle/AutoCompleteSingle.d.ts +5 -7
  16. package/dist/es/src/components/Form/Checkbox/Checkbox.d.ts +4 -7
  17. package/dist/es/src/components/Form/CheckboxGroup/CheckboxGroup.d.ts +4 -12
  18. package/dist/es/src/components/Form/CheckboxGroup/checkboxgroup.interface.d.ts +8 -0
  19. package/dist/es/src/components/Form/DatePicker/DatePicker.d.ts +1 -1
  20. package/dist/es/src/components/Form/MultiSelect/MultiSelect.d.ts +4 -7
  21. package/dist/es/src/components/Form/RadioGroup/RadioGroup.d.ts +2 -5
  22. package/dist/es/src/components/Form/Select/Select.d.ts +5 -7
  23. package/dist/es/src/components/Form/Switch/Switch.d.ts +1 -4
  24. package/dist/es/src/components/Form/TextField/TextField.d.ts +5 -6
  25. package/dist/es/src/components/Form/TimePicker/TimePicker.d.ts +20 -0
  26. package/dist/es/src/components/Form/TimePicker/index.d.ts +1 -0
  27. package/dist/es/src/components/IconButton/IconButton.d.ts +5 -7
  28. package/dist/es/src/components/IconProvider/IconProvider.d.ts +1 -4
  29. package/dist/es/src/components/Link/Link.d.ts +1 -4
  30. package/dist/es/src/components/MenuItem/MenuItem.d.ts +7 -10
  31. package/dist/es/src/components/Navigation/Stepper/Step.d.ts +1 -1
  32. package/dist/es/src/components/Navigation/Stepper/Stepper.d.ts +1 -1
  33. package/dist/es/src/components/Pagination/Pagination.d.ts +3 -6
  34. package/dist/es/src/components/Snackbar/Snackbar.d.ts +1 -4
  35. package/dist/es/src/components/Text/Text.d.ts +1 -4
  36. package/dist/es/src/components/Tooltip/Tooltip.d.ts +5 -7
  37. package/dist/es/src/components/UploadDocument/FileUploaderSingle.d.ts +55 -8
  38. package/dist/es/src/components/UploadDocument/fileuploadersingle.interface.d.ts +5 -0
  39. package/dist/es/src/components/index.d.ts +2 -0
  40. package/dist/es/src/helpers/GooglePickerWrapper.d.ts +2 -1
  41. package/dist/es/src/hooks/useGooleDrivePicker.d.ts +1 -1
  42. package/package.json +20 -20
  43. package/src/components/Accordion/Accordion.tsx +4 -4
  44. package/src/components/BannerNotification/BannerNotification.tsx +0 -2
  45. package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -2
  46. package/src/components/Button/Button.tsx +0 -2
  47. package/src/components/Chip/Chip.tsx +1 -3
  48. package/src/components/Datatable/Datatable.tsx +27 -6
  49. package/src/components/Datatable/DatatableCellRender.tsx +2 -1
  50. package/src/components/Datatable/datatable.interface.ts +5 -4
  51. package/src/components/Datatable/use-pagination-props.hook.ts +2 -2
  52. package/src/components/EmbbededNotification/EmbeddedNotification.tsx +0 -2
  53. package/src/components/Form/AutoCompleteMulti/AutoCompleteMulti.tsx +24 -9
  54. package/src/components/Form/AutoCompleteSingle/AutoCompleteSingle.tsx +15 -10
  55. package/src/components/Form/Checkbox/Checkbox.tsx +22 -25
  56. package/src/components/Form/CheckboxGroup/CheckboxGroup.tsx +8 -25
  57. package/src/components/Form/CheckboxGroup/checkboxgroup.interface.ts +22 -0
  58. package/src/components/Form/DatePicker/DatePicker.tsx +15 -3
  59. package/src/components/Form/MultiSelect/MultiSelect.tsx +33 -7
  60. package/src/components/Form/RadioGroup/RadioGroup.tsx +18 -23
  61. package/src/components/Form/Select/Select.tsx +34 -6
  62. package/src/components/Form/Switch/Switch.tsx +0 -2
  63. package/src/components/Form/TextField/TextField.tsx +120 -107
  64. package/src/components/Form/TimePicker/TimePicker.tsx +228 -0
  65. package/src/components/Form/TimePicker/index.ts +1 -0
  66. package/src/components/IconButton/IconButton.tsx +12 -6
  67. package/src/components/IconProvider/IconProvider.tsx +3 -4
  68. package/src/components/Link/Link.tsx +0 -2
  69. package/src/components/MenuItem/MenuItem.tsx +10 -39
  70. package/src/components/Navigation/Stepper/Step.tsx +1 -1
  71. package/src/components/Navigation/Stepper/Stepper.tsx +1 -1
  72. package/src/components/Pagination/Pagination.tsx +4 -5
  73. package/src/components/Snackbar/Snackbar.tsx +0 -2
  74. package/src/components/Text/Text.tsx +0 -2
  75. package/src/components/Tooltip/Tooltip.tsx +41 -32
  76. package/src/components/UploadDocument/FileUploaderSingle.tsx +185 -88
  77. package/src/components/UploadDocument/fileuploadersingle.interface.ts +5 -0
  78. package/src/components/index.ts +2 -0
  79. package/src/helpers/GooglePickerWrapper.tsx +2 -2
  80. package/src/hooks/useGooleDrivePicker.ts +8 -6
  81. package/src/types/global.d.ts +6 -4
  82. package/src/types/googleDrive.ts +1 -0
  83. package/dist/es/src/helpers/dataGetValue.d.ts +0 -2
  84. package/src/helpers/dataGetValue.ts +0 -22
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "name": "@groupeactual/ui-kit",
3
- "version": "1.7.0-beta.0",
3
+ "version": "1.7.0-beta.4",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "devDependencies": {
7
- "@babel/core": "^7.25.2",
8
- "@babel/preset-env": "^7.25.4",
9
- "@babel/preset-react": "^7.24.7",
10
- "@babel/preset-typescript": "^7.24.7",
11
- "@groupeactual/code-quality-front": "^1.2.1",
12
- "@mdx-js/react": "^3.0.1",
13
- "@types/google.picker": "^0.0.43",
14
- "@types/lodash": "^4.17.12",
7
+ "@babel/core": "^7.26.0",
8
+ "@babel/preset-env": "^7.26.0",
9
+ "@babel/preset-react": "^7.25.9",
10
+ "@babel/preset-typescript": "^7.26.0",
11
+ "@groupeactual/code-quality-front": "^1.3.0",
12
+ "@mdx-js/react": "^3.1.0",
13
+ "@types/google.picker": "^0.0.46",
14
+ "@types/lodash": "^4.17.13",
15
15
  "@types/react": "^18.3.12",
16
16
  "@types/styled-components": "^5.1.34",
17
- "babel-loader": "^9.1.3",
17
+ "babel-loader": "^9.2.1",
18
18
  "clsx": "^2.1.1",
19
19
  "css-loader": "^7.1.2",
20
- "framer-motion": "^11.3.31",
20
+ "framer-motion": "^11.11.17",
21
21
  "identity-obj-proxy": "^3.0.0",
22
22
  "lodash": "^4.17.21",
23
- "postcss": "^8.4.47",
23
+ "postcss": "^8.4.49",
24
24
  "prettier": "^3.3.3",
25
25
  "prop-types": "^15.8.1",
26
- "sass": "^1.77.8",
27
- "sass-loader": "^16.0.2",
26
+ "sass": "^1.81.0",
27
+ "sass-loader": "^16.0.3",
28
28
  "style-loader": "^4.0.0",
29
29
  "styled-components": "^6.1.13",
30
- "tslib": "^2.7.0",
31
- "typescript": "^5.5.4"
30
+ "tslib": "^2.8.1",
31
+ "typescript": "^5.6.3"
32
32
  },
33
33
  "main": "dist/cjs/index.js",
34
34
  "module": "dist/es/index.js",
@@ -42,8 +42,8 @@
42
42
  "@emotion/react": "^11.13.3",
43
43
  "@emotion/serialize": "^1.3.2",
44
44
  "@emotion/styled": "^11.13.0",
45
- "@fortawesome/fontawesome-svg-core": "^6.6.0",
46
- "@fortawesome/free-brands-svg-icons": "^6.6.0",
45
+ "@fortawesome/fontawesome-svg-core": "6.6.0",
46
+ "@fortawesome/free-brands-svg-icons": "6.6.0",
47
47
  "@fortawesome/pro-regular-svg-icons": "git+https://github.com/actualtysoft/pro-regular-svg-icons.git#6.4.2",
48
48
  "@fortawesome/pro-solid-svg-icons": "git+https://github.com/actualtysoft/pro-solid-svg-icons.git#6.4.2",
49
49
  "@mui/material": "^5.16.7",
@@ -56,13 +56,13 @@
56
56
  "react": "^18.3.1",
57
57
  "react-dom": "^18.3.1",
58
58
  "react-google-picker": "^0.1.0",
59
- "@groupeactual/design-tokens": "1.7.0-beta.0"
59
+ "@groupeactual/design-tokens": "1.7.0-beta.4"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "rollup -c",
63
63
  "build:watch": "rollup --bundleConfigAsCjs -c -w",
64
64
  "dev": "npm run build:watch",
65
- "eslint": "eslint ./src --ext .js,.jsx,.ts,.tsx",
65
+ "eslint": "eslint --config \"eslint.config.js\" --color \".\"",
66
66
  "lint": "npm run eslint"
67
67
  }
68
68
  }
@@ -17,7 +17,7 @@ import {
17
17
  useTheme,
18
18
  } from '@mui/material';
19
19
 
20
- import IconProvider from '@/components/IconProvider';
20
+ import IconButton from '@/components/IconButton';
21
21
 
22
22
  interface Props extends AccordionProps {
23
23
  title?: string;
@@ -64,7 +64,9 @@ const Accordion = ({
64
64
  {...props}
65
65
  >
66
66
  <AccordionSummary
67
- expandIcon={<IconProvider icon={faChevronDown} size="md" />}
67
+ expandIcon={
68
+ <IconButton variant="table" size="medium" icon={faChevronDown} />
69
+ }
68
70
  sx={{
69
71
  fontWeight: 500,
70
72
  fontSize: 18,
@@ -87,6 +89,4 @@ const Accordion = ({
87
89
  );
88
90
  };
89
91
 
90
- Accordion.displayName = 'Accordion';
91
-
92
92
  export default Accordion;
@@ -30,6 +30,4 @@ const BannerNotification = ({ text, severity, onClose }: Props) => {
30
30
  );
31
31
  };
32
32
 
33
- BannerNotification.displayName = 'BannerNotification';
34
-
35
33
  export default BannerNotification;
@@ -42,6 +42,4 @@ const Breadcrumbs = ({ PageName, links, ...props }: Props) => {
42
42
  );
43
43
  };
44
44
 
45
- Breadcrumbs.displayName = 'Breadcrumbs';
46
-
47
45
  export default Breadcrumbs;
@@ -27,6 +27,4 @@ const Button = ({ variant, children, ...props }: Props) => {
27
27
  );
28
28
  };
29
29
 
30
- Button.displayName = 'Button';
31
-
32
30
  export default Button;
@@ -22,7 +22,7 @@ interface Props
22
22
  label: string;
23
23
  prefixIcon?: IconDefinition;
24
24
  suffixIcon?: IconDefinition;
25
- suffixAction?: (e: MouseEvent) => void;
25
+ suffixAction?: (_e: MouseEvent) => void;
26
26
  suffixTooltip?: string;
27
27
  tooltip?: string;
28
28
  maxWidth?: string | number;
@@ -145,6 +145,4 @@ const Chip = ({
145
145
  );
146
146
  };
147
147
 
148
- Chip.displayName = 'Chip';
149
-
150
148
  export default Chip;
@@ -32,6 +32,7 @@ const Datatable = <T extends object>({
32
32
  withHeader = false,
33
33
  withPagination,
34
34
  columns,
35
+ isTableLayoutFixed = false,
35
36
  ...props
36
37
  }: Props<T>) => {
37
38
  const { trans, limits, withTopPagination, setPage, setLimit } =
@@ -84,8 +85,14 @@ const Datatable = <T extends object>({
84
85
  return (
85
86
  <StyledDatatable>
86
87
  {withTopPagination && <SyncedPagination />}
87
- <TableContainer>
88
- <Table>
88
+ <TableContainer
89
+ sx={{ display: 'flex', maxWidth: '100%', overflow: 'auto' }}
90
+ >
91
+ <Table
92
+ sx={{
93
+ tableLayout: isTableLayoutFixed ? 'fixed' : 'auto',
94
+ }}
95
+ >
89
96
  {withHeader && (
90
97
  <TableHead>
91
98
  <TableRow data-testid="datatable-head-row">
@@ -104,8 +111,9 @@ const Datatable = <T extends object>({
104
111
  key={name}
105
112
  variant="head"
106
113
  sx={{
114
+ overflow: 'hidden',
115
+ textOverflow: 'ellipsis',
107
116
  width: width,
108
- maxWidth: width,
109
117
  height: hasTopTitle ? '55px' : 'inherit',
110
118
  }}
111
119
  >
@@ -171,8 +179,10 @@ const Datatable = <T extends object>({
171
179
  key={name}
172
180
  variant="body"
173
181
  sx={{
182
+ overflow: 'hidden',
183
+ textOverflow: 'ellipsis',
184
+ borderColor: 'greyLightDefaultBorder',
174
185
  width: width,
175
- maxWidth: width,
176
186
  border:
177
187
  'details' in record && record.details
178
188
  ? '0px'
@@ -184,8 +194,19 @@ const Datatable = <T extends object>({
184
194
  ))}
185
195
  </TableRow>
186
196
  {'details' in record && record.details && (
187
- <TableRow>
188
- <TableCell sx={{ columnSpan: columns.length }}>
197
+ <TableRow
198
+ sx={{
199
+ borderBottom: '1px solid',
200
+ width: record.width,
201
+ borderColor: 'greyLightDefaultBorder',
202
+ }}
203
+ >
204
+ <TableCell
205
+ sx={{
206
+ columnSpan: columns.length,
207
+ borderBottom: 'none',
208
+ }}
209
+ >
189
210
  {record.details}
190
211
  </TableCell>
191
212
  </TableRow>
@@ -9,8 +9,9 @@ const DatatableCellRender = ({ data }: { data: string }): JSX.Element => {
9
9
  }
10
10
 
11
11
  return (
12
- <Tooltip title={data} placement="top">
12
+ <Tooltip title={data} placement="bottom-start">
13
13
  <Text
14
+ variant="body2Regular"
14
15
  style={{
15
16
  whiteSpace: 'nowrap',
16
17
  overflow: 'hidden',
@@ -14,7 +14,7 @@ export interface PaginationTrans {
14
14
 
15
15
  export type ColumnDatatable<T> = {
16
16
  name: string;
17
- render: (record: T) => JSX.Element;
17
+ render: (_record: T) => JSX.Element;
18
18
  title?: string;
19
19
  topTitle?: string;
20
20
  width?: string;
@@ -30,7 +30,8 @@ type BaseProps<T> = {
30
30
  withPagination: boolean;
31
31
  withHeader?: boolean;
32
32
  sortInfo?: SortInfo | null;
33
- onSort?: (info: SortInfo | null) => void;
33
+ isTableLayoutFixed?: boolean;
34
+ onSort?: (_info: SortInfo | null) => void;
34
35
  };
35
36
 
36
37
  type WithoutPaginationProps = {
@@ -39,8 +40,8 @@ type WithoutPaginationProps = {
39
40
 
40
41
  export type PaginationProps = {
41
42
  withPagination: true;
42
- setPage: (page: number) => void;
43
- setLimit: (limit: number) => void;
43
+ setPage: (_page: number) => void;
44
+ setLimit: (_limit: number) => void;
44
45
  trans: PaginationTrans;
45
46
  withTopPagination?: boolean;
46
47
  limits?: number[];
@@ -7,8 +7,8 @@ const usePaginationProps = <T extends object>(
7
7
  let trans = {} as PaginationTrans;
8
8
  let limits: number[] = [3, 5, 10, 20];
9
9
  let withTopPagination = false;
10
- let setPage: (page: number) => void = () => {};
11
- let setLimit: (limit: number) => void = () => {};
10
+ let setPage: (_page: number) => void = () => {};
11
+ let setLimit: (_limit: number) => void = () => {};
12
12
 
13
13
  if ('trans' in props && props.trans) {
14
14
  trans = props.trans;
@@ -99,6 +99,4 @@ const EmbeddedNotification = ({
99
99
  );
100
100
  };
101
101
 
102
- EmbeddedNotification.displayName = 'EmbeddedNotification';
103
-
104
102
  export default EmbeddedNotification;
@@ -1,7 +1,12 @@
1
1
  import React, { useMemo, useRef } from 'react';
2
2
 
3
- import { faSearch } from '@fortawesome/pro-regular-svg-icons';
4
- import { faCheck, faCircleX, faTimes } from '@fortawesome/pro-solid-svg-icons';
3
+ import {
4
+ faCheck,
5
+ faChevronDown,
6
+ faSearch,
7
+ faTimes,
8
+ } from '@fortawesome/pro-regular-svg-icons';
9
+ import { faCircleX } from '@fortawesome/pro-solid-svg-icons';
5
10
  import { AutoCompleteStyle } from '@groupeactual/design-tokens';
6
11
  import {
7
12
  type AutocompleteProps,
@@ -21,20 +26,27 @@ import IconProvider from '@/components/IconProvider';
21
26
  interface AutocompleteMultipleSelectProps<T>
22
27
  extends Omit<
23
28
  AutocompleteProps<T, true, true, false>,
24
- 'onChange' | 'value' | 'options' | 'renderInput' | 'error' | 'autocomplete'
29
+ | 'onChange'
30
+ | 'value'
31
+ | 'options'
32
+ | 'renderInput'
33
+ | 'error'
34
+ | 'autocomplete'
35
+ | 'searchIcon'
25
36
  > {
26
37
  value: T[] | undefined;
27
38
  label?: string;
28
39
  helperText?: string;
29
40
  placeholder?: string;
30
41
  options: T[];
31
- getOptionLabel: (option: T) => string;
32
- getKeyValue: (option: T) => string;
33
- onChange: (value: T[]) => void;
34
- getOptionDisabled?: (option: T) => boolean;
42
+ getOptionLabel: (_option: T) => string;
43
+ getKeyValue: (_option: T) => string;
44
+ onChange: (_value: T[]) => void;
45
+ getOptionDisabled?: (_option: T) => boolean;
35
46
  color?: 'success';
36
47
  width?: number | string;
37
48
  error?: string;
49
+ searchIcon?: boolean;
38
50
  }
39
51
 
40
52
  const AutocompleteMultipleSelect = <T,>({
@@ -51,6 +63,7 @@ const AutocompleteMultipleSelect = <T,>({
51
63
  color,
52
64
  helperText,
53
65
  error,
66
+ searchIcon = false,
54
67
  ...props
55
68
  }: AutocompleteMultipleSelectProps<T>) => {
56
69
  const theme = useTheme();
@@ -104,10 +117,12 @@ const AutocompleteMultipleSelect = <T,>({
104
117
  const getPopupIcon = useMemo(() => {
105
118
  if (color === 'success') {
106
119
  return faCheck;
120
+ } else if (searchIcon) {
121
+ return faSearch;
107
122
  }
108
123
 
109
- return faSearch;
110
- }, [color]);
124
+ return faChevronDown;
125
+ }, [color, searchIcon]);
111
126
 
112
127
  const withPlaceholder = !value?.length && !!placeholder;
113
128
  const boxRef = useRef<HTMLHeadingElement>(null);
@@ -1,7 +1,11 @@
1
1
  import React, { useMemo } from 'react';
2
2
 
3
- import { faSearch } from '@fortawesome/pro-regular-svg-icons';
4
- import { faCheck, faTimes } from '@fortawesome/pro-solid-svg-icons';
3
+ import {
4
+ faCheck,
5
+ faChevronDown,
6
+ faSearch,
7
+ faTimes,
8
+ } from '@fortawesome/pro-regular-svg-icons';
5
9
  import { AutoCompleteStyle } from '@groupeactual/design-tokens';
6
10
  import {
7
11
  Autocomplete,
@@ -27,7 +31,6 @@ interface Props<T>
27
31
  | 'renderInput'
28
32
  | 'error'
29
33
  | 'getOptionLabel'
30
- | 'autocomplete'
31
34
  > {
32
35
  label: string;
33
36
  options: T[];
@@ -35,11 +38,12 @@ interface Props<T>
35
38
  color?: 'success';
36
39
  placeholder?: string;
37
40
  // * Issue on MUI : MUI: The `getOptionLabel` method of Autocomplete returned undefined instead of a string
38
- getOptionLabel: (option: T) => string | null | undefined;
39
- onChange: (value: T | null) => void;
41
+ getOptionLabel: (_option: T) => string | null | undefined;
42
+ onChange: (_value: T | null) => void;
40
43
  value?: T | null;
41
44
  width?: number | string;
42
45
  error?: string;
46
+ searchIcon?: boolean;
43
47
  }
44
48
 
45
49
  const AutoCompleteSingle = <T,>({
@@ -54,6 +58,7 @@ const AutoCompleteSingle = <T,>({
54
58
  color,
55
59
  helperText,
56
60
  error,
61
+ searchIcon = false,
57
62
  ...props
58
63
  }: Props<T>) => {
59
64
  const theme = useTheme();
@@ -112,10 +117,12 @@ const AutoCompleteSingle = <T,>({
112
117
  const getPopupIcon = useMemo(() => {
113
118
  if (color === 'success') {
114
119
  return faCheck;
120
+ } else if (searchIcon) {
121
+ return faSearch;
115
122
  }
116
123
 
117
- return faSearch;
118
- }, [color]);
124
+ return faChevronDown;
125
+ }, [color, searchIcon]);
119
126
 
120
127
  return (
121
128
  <Box sx={{ width }}>
@@ -138,7 +145,7 @@ const AutoCompleteSingle = <T,>({
138
145
  },
139
146
  '& .MuiAutocomplete-popupIndicator': { transform: 'none' },
140
147
  }}
141
- getOptionLabel={getOptionLabel as (option: T) => string}
148
+ getOptionLabel={getOptionLabel as (_option: T) => string}
142
149
  slotProps={{
143
150
  paper: {
144
151
  sx: {
@@ -217,6 +224,4 @@ const AutoCompleteSingle = <T,>({
217
224
  );
218
225
  };
219
226
 
220
- AutoCompleteSingle.displayName = 'AutocompleteSingle';
221
-
222
227
  export default AutoCompleteSingle;
@@ -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
16
  import IconProvider from '@/components/IconProvider';
17
+ import Text from '@/components/Text';
18
18
  import Tooltip from '@/components/Tooltip';
19
19
 
20
20
  interface Props {
21
21
  name: string;
22
22
  value: boolean;
23
- label: string;
23
+ label: ReactNode;
24
24
  onChange?: (
25
- field: string,
26
- value: boolean,
27
- shouldValidate?: boolean | undefined,
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 display="flex">
101
- <Typography component="span" className={getLabelClassName}>
100
+ <Box>
101
+ <Text
102
+ component="span"
103
+ variant="body1"
104
+ className={getLabelClassName}
105
+ >
102
106
  {label}
103
- </Typography>
107
+ </Text>
104
108
  {infoBubbleContent && (
105
- <Box py={0} pl={0.5} display="flex">
106
- <Tooltip
107
- title={infoBubbleContent}
108
- placement={infoBubblePosition}
109
- >
110
- <Box height={12} width={12}>
111
- <IconProvider
112
- icon={faInfoCircle}
113
- size="sm"
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;
@@ -12,33 +12,15 @@ import {
12
12
 
13
13
  import Checkbox from '@/components/Form/Checkbox';
14
14
 
15
- interface ItemType {
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: ItemType[];
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
- setSelectedOptions({
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, faCheck } from '@fortawesome/pro-solid-svg-icons';
9
+ import { faCaretDown } from '@fortawesome/pro-solid-svg-icons';
9
10
  import { DatePickerStyle } from '@groupeactual/design-tokens';
10
11
  import {
11
12
  Box,
@@ -29,7 +30,7 @@ import IconProvider from '@/components/IconProvider';
29
30
  interface Props<T extends Dayjs>
30
31
  extends Omit<DatePickerProps<T>, 'onChange' | 'width'> {
31
32
  value: T | null | undefined;
32
- onChange: (value: T | null | undefined) => void;
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: { px: 0 },
142
+ sx: {
143
+ px: 0,
144
+ '.MuiSvgIcon-root': {
145
+ width: 18,
146
+ height: 18,
147
+ },
148
+ },
137
149
  },
138
150
  }}
139
151
  {...props}