@sonardigital/carbon-ui 1.2.15 → 1.2.17

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.2.15",
3
+ "version": "1.2.17",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -1,5 +1,10 @@
1
1
  import { Theme } from '@emotion/react';
2
- import { Components, CssVarsTheme, linearProgressClasses } from '@mui/material';
2
+ import {
3
+ ButtonProps,
4
+ Components,
5
+ CssVarsTheme,
6
+ linearProgressClasses,
7
+ } from '@mui/material';
3
8
  import { palette } from './palette';
4
9
 
5
10
  const defaultButtonStyle = {
@@ -13,6 +18,27 @@ const defaultButtonStyle = {
13
18
 
14
19
  const borderRadius = 1;
15
20
 
21
+ const generateButtonVariants = (
22
+ color: Exclude<NonNullable<ButtonProps['color']>, 'inherit'>,
23
+ ) => {
24
+ return {
25
+ props: {
26
+ variant: 'contained' as const,
27
+ color,
28
+ },
29
+ style: ({ theme }: any) => ({
30
+ ...defaultButtonStyle,
31
+ backgroundColor: theme.palette[color].light,
32
+ color: theme.palette[color].main,
33
+ '&:hover': {
34
+ boxShadow: 0,
35
+ backgroundColor: theme.palette[color].main,
36
+ color: 'white',
37
+ },
38
+ }),
39
+ };
40
+ };
41
+
16
42
  export const components: Components<
17
43
  Omit<Theme, 'components' | 'palette'> & CssVarsTheme
18
44
  > = {
@@ -202,7 +228,15 @@ export const components: Components<
202
228
  },
203
229
  },
204
230
  },
205
-
231
+ MuiSkeleton: {
232
+ defaultProps: {
233
+ variant: 'rounded',
234
+ animation: 'wave',
235
+ sx: {
236
+ bgcolor: 'grey.100',
237
+ },
238
+ },
239
+ },
206
240
  MuiAccordionDetails: {
207
241
  defaultProps: {
208
242
  sx: {
@@ -290,54 +324,12 @@ export const components: Components<
290
324
  },
291
325
  MuiButton: {
292
326
  variants: [
293
- {
294
- props: {
295
- variant: 'contained',
296
- color: 'primary',
297
- },
298
- style: ({ theme }) => ({
299
- ...defaultButtonStyle,
300
- backgroundColor: theme.palette.primary.light,
301
- color: theme.palette.primary.main,
302
- '&:hover': {
303
- boxShadow: 0,
304
- backgroundColor: theme.palette.primary.main,
305
- color: 'white',
306
- },
307
- }),
308
- },
309
- {
310
- props: {
311
- variant: 'contained',
312
- color: 'secondary',
313
- },
314
- style: ({ theme }) => ({
315
- ...defaultButtonStyle,
316
- backgroundColor: theme.palette.secondary.light,
317
- color: theme.palette.secondary.main,
318
- '&:hover': {
319
- boxShadow: 0,
320
- backgroundColor: theme.palette.secondary.main,
321
- color: 'white',
322
- },
323
- }),
324
- },
325
- {
326
- props: {
327
- variant: 'contained',
328
- color: 'info',
329
- },
330
- style: ({ theme }) => ({
331
- ...defaultButtonStyle,
332
- paddingTop: 10,
333
- backgroundColor: theme.palette.info.light,
334
- color: theme.palette.info.main,
335
- '&:hover': {
336
- backgroundColor: theme.palette.info.main,
337
- color: 'white',
338
- },
339
- }),
340
- },
327
+ generateButtonVariants('primary'),
328
+ generateButtonVariants('secondary'),
329
+ generateButtonVariants('info'),
330
+ generateButtonVariants('error'),
331
+ generateButtonVariants('success'),
332
+ generateButtonVariants('warning'),
341
333
  {
342
334
  props: {
343
335
  variant: 'text',