@sonardigital/carbon-ui 1.1.71 → 1.1.72
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
|
@@ -10,7 +10,7 @@ import { useState } from 'react';
|
|
|
10
10
|
interface AccordionsProps {
|
|
11
11
|
items: {
|
|
12
12
|
title: string;
|
|
13
|
-
|
|
13
|
+
description: string;
|
|
14
14
|
}[];
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ export function Accordions({ items }: AccordionsProps): React.ReactElement {
|
|
|
18
18
|
const [index, setIndex] = useState(0);
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<Stack
|
|
21
|
+
<Stack spacing="sm">
|
|
22
22
|
{items?.map((a, i) => (
|
|
23
23
|
<Accordion
|
|
24
24
|
key={i}
|
|
@@ -35,7 +35,7 @@ export function Accordions({ items }: AccordionsProps): React.ReactElement {
|
|
|
35
35
|
variant="body2"
|
|
36
36
|
style={{ fontWeight: 400, opacity: 0.6 }}
|
|
37
37
|
>
|
|
38
|
-
{a.
|
|
38
|
+
{a.description}
|
|
39
39
|
</Typography>
|
|
40
40
|
</AccordionDetails>
|
|
41
41
|
</Accordion>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ButtonBase,
|
|
3
|
+
Grid,
|
|
4
|
+
Stack,
|
|
5
|
+
Tooltip,
|
|
6
|
+
Typography,
|
|
7
|
+
useTheme,
|
|
8
|
+
} from '@mui/material';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Card } from '@mui/material';
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line
|
|
13
|
+
interface ScrollingCardsProps {
|
|
14
|
+
items: {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
color: string;
|
|
18
|
+
bgcolor: string;
|
|
19
|
+
tooltip: string;
|
|
20
|
+
icon: React.ReactNode;
|
|
21
|
+
onClick: () => void;
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function ScrollingCards({
|
|
26
|
+
items,
|
|
27
|
+
}: ScrollingCardsProps): React.ReactElement {
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Grid container spacing={2}>
|
|
32
|
+
{items?.map(contact => (
|
|
33
|
+
<Grid size={{ xs: 12, sm: 4 }}>
|
|
34
|
+
<Tooltip title={contact.tooltip} sx={{ width: '100%' }}>
|
|
35
|
+
<ButtonBase
|
|
36
|
+
sx={{
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: '100%',
|
|
39
|
+
borderRadius: 1.5,
|
|
40
|
+
}}
|
|
41
|
+
onClick={() => contact.onClick()}
|
|
42
|
+
>
|
|
43
|
+
<Card
|
|
44
|
+
sx={{
|
|
45
|
+
...theme.components?.MuiCard?.defaultProps?.sx,
|
|
46
|
+
height: 230,
|
|
47
|
+
width: '100%',
|
|
48
|
+
cursor: 'pointer',
|
|
49
|
+
'&:hover': {
|
|
50
|
+
backgroundColor: contact.bgcolor,
|
|
51
|
+
},
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<Stack
|
|
55
|
+
sx={{
|
|
56
|
+
width: '100%',
|
|
57
|
+
flexDirection: 'column',
|
|
58
|
+
height: '100%',
|
|
59
|
+
alignItems: 'flex-start',
|
|
60
|
+
justifyContent: 'space-between',
|
|
61
|
+
boxSizing: 'border-box',
|
|
62
|
+
padding: 2.5,
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
<Card
|
|
66
|
+
// eslint-disable-next-line
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
variant="numeric"
|
|
69
|
+
sx={{
|
|
70
|
+
marginBottom: 1,
|
|
71
|
+
bgcolor: 'white',
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
{contact.icon}
|
|
75
|
+
</Card>
|
|
76
|
+
<Stack sx={{ alignItems: 'flex-start' }}>
|
|
77
|
+
<Typography variant="h6" color={contact.color}>
|
|
78
|
+
{contact.title}
|
|
79
|
+
</Typography>
|
|
80
|
+
<Typography
|
|
81
|
+
variant="body1"
|
|
82
|
+
sx={{ textAlign: 'left' }}
|
|
83
|
+
>
|
|
84
|
+
{contact.description}
|
|
85
|
+
</Typography>
|
|
86
|
+
</Stack>
|
|
87
|
+
</Stack>
|
|
88
|
+
</Card>
|
|
89
|
+
</ButtonBase>
|
|
90
|
+
</Tooltip>
|
|
91
|
+
</Grid>
|
|
92
|
+
))}
|
|
93
|
+
</Grid>
|
|
94
|
+
);
|
|
95
|
+
}
|