@sonardigital/carbon-ui 1.1.81 → 1.1.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonardigital/carbon-ui",
3
- "version": "1.1.81",
3
+ "version": "1.1.83",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -1,5 +1,6 @@
1
- import { Card } from '@mui/material';
1
+ import { Card, Stack } from '@mui/material';
2
2
  import { Controller } from 'react-hook-form';
3
+ import CheckCircleIcon from '@mui/icons-material/CheckCircle';
3
4
 
4
5
  export function FormBox({
5
6
  name,
@@ -18,22 +19,38 @@ export function FormBox({
18
19
  <Controller
19
20
  name={name}
20
21
  render={({ field }) => (
21
- <Card
22
- // eslint-disable-next-line
23
- // @ts-ignore
24
- variant="numeric"
25
- sx={{
26
- bgcolor: `${color}.light`,
27
- height: 65,
28
- width: '100%',
29
- borderRadius: 2.2,
30
- border: 2,
31
- borderColor: `${color}.${value === field.value ? 'main' : 'light'}`,
32
- ...sx,
33
- }}
34
- >
35
- {children}
36
- </Card>
22
+ <Stack sx={{ position: 'relative' }}>
23
+ {value === field.value && (
24
+ <CheckCircleIcon
25
+ sx={{
26
+ width: 19,
27
+ height: 19,
28
+ position: 'absolute',
29
+ top: 10,
30
+ right: 10,
31
+ color: `${color}.main`,
32
+ }}
33
+ />
34
+ )}
35
+ <Card
36
+ // eslint-disable-next-line
37
+ // @ts-ignore
38
+ variant="numeric"
39
+ sx={{
40
+ bgcolor: `${color}.light`,
41
+ height: 65,
42
+ width: '100%',
43
+ borderRadius: 2.2,
44
+ border: 2,
45
+ transition: '0.2s',
46
+ borderColor: `${color}.${value === field.value ? 'main' : 'light'}`,
47
+ ...sx,
48
+ }}
49
+ onClick={() => field.onChange(value)}
50
+ >
51
+ {children}
52
+ </Card>
53
+ </Stack>
37
54
  )}
38
55
  />
39
56
  );