@sonardigital/carbon-ui 1.1.67 → 1.1.69

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.67",
3
+ "version": "1.1.69",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -0,0 +1,45 @@
1
+ import {
2
+ Accordion,
3
+ AccordionDetails,
4
+ AccordionSummary,
5
+ Stack,
6
+ Typography,
7
+ } from '@mui/material';
8
+ import { useState } from 'react';
9
+
10
+ interface AccordionsProps {
11
+ items: {
12
+ title: string;
13
+ descriptions: string;
14
+ }[];
15
+ }
16
+
17
+ export function Accordions({ items }: AccordionsProps): React.ReactElement {
18
+ const [index, setIndex] = useState(0);
19
+
20
+ return (
21
+ <Stack gap={2}>
22
+ {items?.map((a, i) => (
23
+ <Accordion
24
+ key={i}
25
+ expanded={index === i}
26
+ onChange={() => setIndex(index === i ? -1 : i)}
27
+ >
28
+ <AccordionSummary>
29
+ <Typography variant="body1" fontWeight={400}>
30
+ {a.title}
31
+ </Typography>
32
+ </AccordionSummary>
33
+ <AccordionDetails>
34
+ <Typography
35
+ variant="body2"
36
+ style={{ fontWeight: 400, opacity: 0.6 }}
37
+ >
38
+ {a.descriptions}
39
+ </Typography>
40
+ </AccordionDetails>
41
+ </Accordion>
42
+ ))}
43
+ </Stack>
44
+ );
45
+ }
@@ -6,3 +6,4 @@ export * from './delay';
6
6
  export * from './modal';
7
7
  export * from './bottom-navigation/BottomNavigation';
8
8
  export * from './multisteps';
9
+ export * from './accordions/Accordions';
@@ -126,7 +126,8 @@ export const components: Components<
126
126
  defaultProps: {
127
127
  maxWidth: 'lg',
128
128
  sx: {
129
- paddingY: 12,
129
+ paddingY: { xs: 11, md: 12.5 },
130
+ paddingX: { xs: 3 },
130
131
  },
131
132
  style: {
132
133
  height: '100%',
@@ -0,0 +1,3 @@
1
+ export const shape = {
2
+ borderRadius: 4,
3
+ };
@@ -1,35 +1,62 @@
1
1
  export const typography = {
2
2
  fontFamily: `Inter`,
3
3
  h1: {
4
- fontSize: '4.0rem',
4
+ fontSize: '3.1rem',
5
5
  fontWeight: 500,
6
6
  letterSpacing: -0.1,
7
+ '@media (max-width:600px)': {
8
+ fontSize: '3.35rem',
9
+ fontWeight: 600,
10
+ lineHeight: 1.18,
11
+ },
7
12
  },
8
13
  h2: {
9
- fontSize: '3.8rem',
14
+ fontSize: '2.8rem',
10
15
  fontWeight: 550,
11
16
  },
12
17
  h3: {
13
- fontSize: '2.6rem',
18
+ fontSize: '2.4rem',
14
19
  fontWeight: 500,
20
+ lineHeight: 1.28,
21
+ '@media (max-width:600px)': {
22
+ fontSize: '2.3rem',
23
+ fontWeight: 600,
24
+ lineHeight: 1.25,
25
+ },
15
26
  },
16
27
  h4: {
17
28
  fontSize: '2.2rem',
18
29
  fontWeight: 500,
19
30
  },
20
31
  h5: {
21
- fontSize: '2.1rem',
32
+ fontSize: '2.15rem',
22
33
  fontWeight: 500,
23
34
  },
35
+ h6: {
36
+ fontFamily: 'Bricolage Grotesque, sans-serif',
37
+ fontSize: '2.3rem',
38
+ fontWeight: 500,
39
+ '@media (max-width:600px)': {
40
+ fontSize: '2.2rem',
41
+ },
42
+ },
24
43
  body1: {
25
44
  fontSize: '1.9rem',
26
45
  lineHeight: 1.5,
27
46
  fontWeight: 350,
47
+ '@media (max-width:600px)': {
48
+ fontSize: '1.9rem',
49
+ lineHeight: 1.45,
50
+ fontWeight: 400,
51
+ },
28
52
  },
29
53
  body2: {
30
- fontSize: '1.7rem',
54
+ fontSize: '1.8rem',
31
55
  fontWeight: 350,
32
56
  lineHeight: 1.5,
57
+ '@media (max-width:600px)': {
58
+ fontWeight: 400,
59
+ },
33
60
  },
34
61
  caption: {
35
62
  fontSize: '1.5rem',
@@ -42,5 +69,9 @@ export const typography = {
42
69
  fontWeight: 350,
43
70
  textTransform: 'none',
44
71
  letterSpacing: 0.1,
72
+ '@media (max-width:600px)': {
73
+ fontSize: '2rem',
74
+ fontWeight: 500,
75
+ },
45
76
  },
46
77
  };
@@ -2,6 +2,7 @@ import { createTheme } from '@mui/material';
2
2
  import { typography } from './constants/typography';
3
3
  import { components } from './constants/components';
4
4
  import { palette } from './constants/palette';
5
+ import { shape } from './constants/shape';
5
6
 
6
7
  export const defaultTheme = createTheme({
7
8
  palette,
@@ -10,5 +11,106 @@ export const defaultTheme = createTheme({
10
11
  // @ts-ignore
11
12
  typography,
12
13
  components,
13
- shape: { borderRadius: 4 },
14
+ shape,
15
+ });
16
+
17
+ export const darkTheme = createTheme({
18
+ palette: {
19
+ ...palette,
20
+ info: {
21
+ dark: '#041222ff',
22
+ main: '#0b2645ff',
23
+ light: '#286cabff',
24
+ },
25
+ warning: {
26
+ dark: '#322603ff',
27
+ main: '#74580cff',
28
+ light: '#FFE8D7',
29
+ },
30
+ secondary: {
31
+ main: '#95219eff',
32
+ light: '#9c52c2ff',
33
+ },
34
+ success: {
35
+ dark: '#1C543A',
36
+ main: '#03130bff',
37
+ light: '#137349ff',
38
+ },
39
+ divider: '#35383dff',
40
+ mode: 'dark',
41
+ background: { default: '#0C0D0E', paper: '#161616' },
42
+ },
43
+ typography,
44
+ components: {
45
+ ...components,
46
+ ...defaultTheme.components,
47
+ MuiTextField: {
48
+ ...defaultTheme.components?.MuiTextField,
49
+ defaultProps: {
50
+ ...defaultTheme.components?.MuiTextField?.defaultProps,
51
+ sx: {
52
+ ...defaultTheme.components?.MuiTextField?.defaultProps?.sx,
53
+
54
+ '& .MuiOutlinedInput-root': {
55
+ '& fieldset': {
56
+ borderColor: '#35383dff',
57
+ },
58
+ '&:hover fieldset': {
59
+ borderColor: 'info.light',
60
+ },
61
+ '&.Mui-focused fieldset': {
62
+ borderColor: 'info.light',
63
+ },
64
+ },
65
+ input: { color: 'white' },
66
+ },
67
+ },
68
+ },
69
+ MuiAutocomplete: {
70
+ ...defaultTheme.components?.MuiAutocomplete,
71
+ defaultProps: {
72
+ ...defaultTheme.components?.MuiAutocomplete?.defaultProps,
73
+ slotProps: {
74
+ paper: {
75
+ ...defaultTheme.components?.MuiAutocomplete?.defaultProps
76
+ ?.slotProps?.paper,
77
+ sx: {
78
+ // eslint-disable-next-line
79
+ ...defaultTheme.components?.MuiAutocomplete?.defaultProps // @ts-ignore
80
+ ?.slotProps?.paper?.sx,
81
+ backgroundColor: '#0C0D0E',
82
+ color: 'white',
83
+ border: 1,
84
+ borderStyle: 'solid',
85
+ },
86
+ },
87
+ },
88
+ },
89
+ },
90
+ MuiAccordion: {
91
+ ...defaultTheme.components?.MuiAccordion,
92
+ defaultProps: {
93
+ ...defaultTheme.components?.MuiAccordion?.defaultProps,
94
+ sx: {
95
+ ...defaultTheme.components?.MuiAccordion?.defaultProps?.sx,
96
+ color: 'white',
97
+ bgcolor: '#0a0a0aff',
98
+ opacity: 1,
99
+ },
100
+ },
101
+ },
102
+ MuiAccordionDetails: {
103
+ defaultProps: {
104
+ sx: {
105
+ padding: 2,
106
+ display: 'flex',
107
+ flexDirection: 'column',
108
+ gap: 1,
109
+ borderTop: 5,
110
+ borderColor: '#0C0D0E',
111
+ },
112
+ },
113
+ },
114
+ },
115
+ shape,
14
116
  });