@sonardigital/carbon-ui 1.1.67 → 1.1.70

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.70",
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';
@@ -29,6 +29,56 @@ export const components: Components<
29
29
  },
30
30
  },
31
31
  },
32
+ MuiStack: {
33
+ variants: [
34
+ {
35
+ props: { spacing: 'xxs' },
36
+ style: {
37
+ gap: 2.5,
38
+ },
39
+ },
40
+ {
41
+ props: { spacing: 'xs' },
42
+ style: {
43
+ gap: 5,
44
+ },
45
+ },
46
+ {
47
+ props: { spacing: 'sm' },
48
+ style: {
49
+ gap: 12,
50
+ },
51
+ },
52
+ {
53
+ props: { spacing: 'md' },
54
+ style: {
55
+ gap: 22.5,
56
+ },
57
+ },
58
+ {
59
+ props: { spacing: 'lg' },
60
+ style: {
61
+ gap: 40,
62
+ },
63
+ },
64
+ {
65
+ props: { spacing: 'xl' },
66
+ style: {
67
+ gap: 55,
68
+ },
69
+ },
70
+ {
71
+ props: { spacing: 'xxl' },
72
+ style: {
73
+ gap: 70,
74
+ },
75
+ },
76
+ ],
77
+ defaultProps: {
78
+ spacing: 'xxs',
79
+ },
80
+ },
81
+
32
82
  MuiAutocomplete: {
33
83
  defaultProps: {
34
84
  slotProps: {
@@ -122,19 +172,6 @@ export const components: Components<
122
172
  },
123
173
  },
124
174
  },
125
- MuiContainer: {
126
- defaultProps: {
127
- maxWidth: 'lg',
128
- sx: {
129
- paddingY: 12,
130
- },
131
- style: {
132
- height: '100%',
133
- alignItems: 'center',
134
- justifyContent: 'center',
135
- },
136
- },
137
- },
138
175
  MuiPaper: {
139
176
  variants: [
140
177
  {
@@ -158,14 +195,6 @@ export const components: Components<
158
195
  },
159
196
  },
160
197
  },
161
- MuiStack: {
162
- defaultProps: {
163
- style: {
164
- borderColor: '#D4D6DE',
165
- borderWidth: 1,
166
- },
167
- },
168
- },
169
198
  MuiChip: {
170
199
  defaultProps: {
171
200
  style: {
@@ -0,0 +1,3 @@
1
+ export const shape = {
2
+ borderRadius: 4,
3
+ };
@@ -1,35 +1,80 @@
1
+ const fontFamily = {
2
+ primary: 'Inter, sans-serif',
3
+ secondary: 'Bricolage Grotesque, sans-serif',
4
+ };
5
+
1
6
  export const typography = {
2
- fontFamily: `Inter`,
7
+ fontFamily: fontFamily.primary,
3
8
  h1: {
4
- fontSize: '4.0rem',
9
+ fontSize: '3.1rem',
5
10
  fontWeight: 500,
6
11
  letterSpacing: -0.1,
12
+ '@media (max-width:600px)': {
13
+ fontSize: '3.35rem',
14
+ fontWeight: 600,
15
+ lineHeight: 1.18,
16
+ letterSpacing: -0.2,
17
+ },
7
18
  },
8
19
  h2: {
9
- fontSize: '3.8rem',
20
+ fontSize: '2.8rem',
10
21
  fontWeight: 550,
22
+ '@media (max-width:600px)': {
23
+ fontSize: '2.8rem',
24
+ fontWeight: 600,
25
+ },
11
26
  },
12
27
  h3: {
13
- fontSize: '2.6rem',
28
+ fontSize: '2.4rem',
14
29
  fontWeight: 500,
30
+ lineHeight: 1.28,
31
+ '@media (max-width:600px)': {
32
+ fontSize: '2.3rem',
33
+ fontWeight: 600,
34
+ lineHeight: 1.25,
35
+ },
15
36
  },
16
37
  h4: {
17
38
  fontSize: '2.2rem',
18
39
  fontWeight: 500,
40
+ '@media (max-width:600px)': {
41
+ fontWeight: 600,
42
+ },
19
43
  },
20
44
  h5: {
21
- fontSize: '2.1rem',
45
+ fontSize: '2.15rem',
46
+ fontWeight: 500,
47
+ paddingLeft: 0.4,
48
+ '@media (max-width:600px)': {
49
+ fontSize: '2.2rem',
50
+ },
51
+ },
52
+ h6: {
53
+ fontFamily: fontFamily.secondary,
54
+ fontSize: '2.3rem',
22
55
  fontWeight: 500,
56
+ lineHeight: 1.25,
57
+ '@media (max-width:600px)': {
58
+ fontSize: '2.2rem',
59
+ },
23
60
  },
24
61
  body1: {
25
62
  fontSize: '1.9rem',
26
63
  lineHeight: 1.5,
27
64
  fontWeight: 350,
65
+ '@media (max-width:600px)': {
66
+ fontSize: '1.9rem',
67
+ lineHeight: 1.45,
68
+ fontWeight: 400,
69
+ },
28
70
  },
29
71
  body2: {
30
- fontSize: '1.7rem',
72
+ fontSize: '1.8rem',
31
73
  fontWeight: 350,
32
74
  lineHeight: 1.5,
75
+ '@media (max-width:600px)': {
76
+ fontWeight: 400,
77
+ },
33
78
  },
34
79
  caption: {
35
80
  fontSize: '1.5rem',
@@ -42,5 +87,9 @@ export const typography = {
42
87
  fontWeight: 350,
43
88
  textTransform: 'none',
44
89
  letterSpacing: 0.1,
90
+ '@media (max-width:600px)': {
91
+ fontSize: '2rem',
92
+ fontWeight: 500,
93
+ },
45
94
  },
46
95
  };
@@ -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,182 @@ 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
+ MuiContainer: {
103
+ variants: [
104
+ {
105
+ props: { className: 'xs' },
106
+ style: {
107
+ paddingTop: 22.5,
108
+ paddingBottom: 22.5,
109
+ paddingLeft: 22.5,
110
+ paddingRight: 22.5,
111
+ },
112
+ },
113
+ {
114
+ props: { className: 'sm' },
115
+ style: ({ theme }: { theme: Theme }) => ({
116
+ paddingTop: 35,
117
+ paddingBottom: 35,
118
+ paddingLeft: 22.5,
119
+ paddingRight: 22.5,
120
+ [theme.breakpoints.down('sm')]: {
121
+ paddingTop: 30,
122
+ paddingBottom: 30,
123
+ },
124
+ }),
125
+ },
126
+ {
127
+ props: { className: 'md' },
128
+ style: ({ theme }: { theme: Theme }) => ({
129
+ paddingTop: 50,
130
+ paddingBottom: 50,
131
+ paddingLeft: 22.5,
132
+ paddingRight: 22.5,
133
+ [theme.breakpoints.down('sm')]: {
134
+ paddingTop: 40,
135
+ paddingBottom: 40,
136
+ },
137
+ }),
138
+ },
139
+ {
140
+ props: { className: 'lg' },
141
+ style: ({ theme }: { theme: Theme }) => ({
142
+ paddingTop: 80,
143
+ paddingBottom: 80,
144
+ paddingLeft: 22.5,
145
+ paddingRight: 22.5,
146
+ [theme.breakpoints.down('sm')]: {
147
+ paddingTop: 70,
148
+ paddingBottom: 70,
149
+ },
150
+ }),
151
+ },
152
+ {
153
+ props: { className: 'xl' },
154
+ style: ({ theme }: { theme: Theme }) => ({
155
+ paddingTop: 100,
156
+ paddingBottom: 100,
157
+ paddingLeft: 22.5,
158
+ paddingRight: 22.5,
159
+ [theme.breakpoints.down('sm')]: {
160
+ paddingTop: 90,
161
+ paddingBottom: 90,
162
+ },
163
+ }),
164
+ },
165
+ ],
166
+ defaultProps: {
167
+ sx: {
168
+ paddingY: { xs: 11, md: 12.5 },
169
+ paddingX: { xs: 3 },
170
+ },
171
+ style: {
172
+ height: '100%',
173
+ alignItems: 'center',
174
+ justifyContent: 'center',
175
+ },
176
+ },
177
+ },
178
+ MuiAccordionDetails: {
179
+ defaultProps: {
180
+ sx: {
181
+ padding: 2,
182
+ display: 'flex',
183
+ flexDirection: 'column',
184
+ gap: 1,
185
+ borderTop: 5,
186
+ borderColor: '#0C0D0E',
187
+ },
188
+ },
189
+ },
190
+ },
191
+ shape,
14
192
  });