Skip to content

Commit e0eecd5

Browse files
authored
Merge pull request #1158 from FaheemOnHub/add/status/colors
add: new color prop "status' for notification snackbars and designCard ribbons
2 parents 0912244 + 0414086 commit e0eecd5

File tree

3 files changed

+64
-4
lines changed

3 files changed

+64
-4
lines changed

src/custom/CustomCatalog/style.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { styled, Typography } from '@mui/material';
2-
import { accentGrey, DARK_PRIMARY_COLOR, GRAY97, slateGray, WHITESMOKE } from '../../theme';
2+
import { accentGrey, DARK_PRIMARY_COLOR, GRAY97, WHITESMOKE } from '../../theme';
33
import { charcoal, DARK_TEAL, SNOW_WHITE } from '../../theme/colors/colors';
44

55
type DesignCardProps = {
@@ -52,9 +52,11 @@ export const StyledInnerClassWrapper = styled('div')<StyledInnerClassWrapperProp
5252
theme
5353
}) => {
5454
const mapToColor: Record<string, string> = {
55-
community: slateGray.main,
56-
official: theme.palette.background.cta?.default || '#EBC017',
57-
verified: theme.palette.background.brand?.default || '#00B39F'
55+
community: theme.palette.catalogStatus?.community,
56+
official:
57+
theme.palette.catalogStatus?.official,
58+
verified:
59+
theme.palette.catalogStatus?.verified
5860
};
5961
return {
6062
font: 'bold 10px sans-serif',

src/theme/palette.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ declare module '@mui/material/styles' {
169169
alt: string;
170170
};
171171
};
172+
status: {
173+
success: string;
174+
warning: string;
175+
error: string;
176+
info: string;
177+
};
178+
catalogStatus: {
179+
community: string;
180+
official: string;
181+
verified: string;
182+
};
172183
}
173184

174185
// surface tokens need to have enough contrast
@@ -261,6 +272,18 @@ declare module '@mui/material/styles' {
261272
alt: string;
262273
};
263274
};
275+
276+
status: {
277+
success: string;
278+
warning: string;
279+
error: string;
280+
info: string;
281+
};
282+
catalogStatus: {
283+
community: string;
284+
official: string;
285+
verified: string;
286+
};
264287
}
265288
}
266289

@@ -416,6 +439,17 @@ export const lightModePalette: PaletteOptions = {
416439
default: Colors.charcoal[40],
417440
alt: Colors.charcoal[40]
418441
}
442+
},
443+
status: {
444+
success: Colors.notificationColors.success.main,
445+
warning: Colors.notificationColors.warning.main,
446+
error: Colors.notificationColors.error.main,
447+
info: Colors.notificationColors.info.main
448+
},
449+
catalogStatus: {
450+
community: Colors.slateGray.main,
451+
official: Colors.saffron[40],
452+
verified: Colors.keppel[40]
419453
}
420454
};
421455

@@ -567,5 +601,16 @@ export const darkModePalette: PaletteOptions = {
567601
default: Colors.accentGrey[100],
568602
alt: Colors.keppel[40]
569603
}
604+
},
605+
status: {
606+
success: Colors.notificationColors.success.main,
607+
warning: Colors.notificationColors.warning.main,
608+
error: Colors.notificationColors.error.main,
609+
info: Colors.notificationColors.info.main
610+
},
611+
catalogStatus: {
612+
community: Colors.slateGray.main,
613+
official: Colors.saffron[40],
614+
verified: Colors.keppel[40]
570615
}
571616
};

src/theme/theme.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,19 @@ export const createCustomTheme = (mode: PaletteMode, primitives?: PrimitivePalet
297297
default: alpha(p.foreground, 0.9),
298298
alt: alpha(p.foreground, 0.8)
299299
}
300+
},
301+
status: {
302+
//->org-independent status colors
303+
success: Colors.notificationColors.success.main,
304+
warning: Colors.notificationColors.warning.main,
305+
error: Colors.notificationColors.error.main,
306+
info: Colors.notificationColors.info.main
307+
},
308+
//->catalog status colors (org-independent)
309+
catalogStatus: {
310+
community: Colors.slateGray.main,
311+
official: Colors.saffron[40],
312+
verified: Colors.keppel[40]
300313
}
301314
}
302315
: {};

0 commit comments

Comments
 (0)