1- import { Interactiveness , PaletteMode , createTheme , alpha , darken } from '@mui/material' ;
1+ import { PaletteMode , createTheme , alpha , darken } from '@mui/material' ;
22import { components } from './components' ;
33import { darkModePalette , lightModePalette , ThemePalette } from './palette' ;
44import { typography } from './typography' ;
@@ -30,7 +30,7 @@ export type PrimitivePalette = {
3030 * Should be visually distinct from `background` to ensure
3131 * navigation elements stand out.
3232 */
33- NavigationBar : string ;
33+ navigationBar : string ;
3434
3535
3636 /**
@@ -125,20 +125,15 @@ export type PrimitivePalette = {
125125 */
126126 foreground : string ;
127127
128- // @deprecated same as primary
129- default ?: string ;
130- // @deprecated same as secondary
131- hover ?: string ;
132-
133128} ;
134129
135130import * as Colors from './colors' ;
136131
137132/**
138133 * Layer5 ( primitives ) defines the raw, brand-level colors used in the UI.
139134 */
140- export const SistentDefaultPrimitivePalette : PrimitivePalette = {
141- NavigationBar : "#252e31" , // used for app navigation bar background
135+ export const SistentDefaultPrimitivePaletteLight : PrimitivePalette = {
136+ navigationBar : "#252e31" , // used for app navigation bar background
142137
143138
144139 primary : Colors . KEPPEL , // maps to background.brand.default, success.default
@@ -155,39 +150,26 @@ export const SistentDefaultPrimitivePalette: PrimitivePalette = {
155150} ;
156151
157152
158- export const digitalOceanPrimitives : PrimitivePalette = {
159- /** Distinct dark navy so the nav stands out from a white page background. */
160- NavigationBar : "#031B4E" ,
161-
162- /** DigitalOcean "Ocean Blue". */
163- primary : "#0069FF" ,
164- /** White text/icons on primary. */
165- primaryInverted : "#FFFFFF" ,
153+ export const SistentDefaultPrimitivePaletteDark : PrimitivePalette = {
154+ navigationBar : "#252e31" , // used for app navigation bar background
166155
167- /** Slate/dark blue-gray used for secondary emphasis. */
168- secondary : "#2E384D" ,
169- /** White text/icons on secondary. */
170- secondaryInverted : "#FFFFFF" ,
156+ primary : Colors . KEPPEL , // maps to background.brand.default, success.default
157+ primaryInverted : Colors . charcoal [ 100 ] , // used for text on KEPL background
171158
172- /** Bright cyan accent used for highlights/CTAs. */
173- accent : "#00A8E8" ,
174- /** White text/icons on accent. */
175- accentInverted : "#FFFFFF" ,
159+ secondary : Colors . DARK_SLATE_GRAY , // used in secondary.main, text.secondary, borders
160+ secondaryInverted : Colors . charcoal [ 100 ] , // for text on secondary-colored backgrounds
176161
177- /** Light UI surface (DO uses a clean white background in light mode). */
178- background : "#FFFFFF" ,
179- /** Default content color (deep navy used across DO’s UI/text). */
180- foreground : "#031B4E" ,
162+ accent : Colors . saffron [ 40 ] , // from background.cta.default
163+ accentInverted : Colors . charcoal [ 100 ] , // text on accent
181164
182- // @deprecated same as primary
183- default : "#0069FF" ,
184- // @deprecated same as secondary
185- hover : "#2E384D"
165+ background : Colors . charcoal [ 10 ] , // app background, cards, tabs
166+ foreground : Colors . charcoal [ 100 ] // primary text color on background
186167} ;
187168
188- export const createCustomTheme = ( mode : PaletteMode , primitives : PrimitivePalette = SistentDefaultPrimitivePalette ) => {
169+ export const createCustomTheme = ( mode : PaletteMode , primitives ? : PrimitivePalette ) => {
189170 const basePalette = mode == 'light' ? lightModePalette : darkModePalette ;
190- const p = SistentDefaultPrimitivePalette
171+ const defaultPrimitives = mode == 'light' ? SistentDefaultPrimitivePaletteLight : SistentDefaultPrimitivePaletteDark ;
172+ const p = primitives ? _ . merge ( { } , defaultPrimitives , primitives , ) : undefined ;
191173
192174 console . log ( 'Creating theme with mode:' , mode , 'and brandPalette:' , primitives ) ;
193175
@@ -199,6 +181,7 @@ export const createCustomTheme = (mode: PaletteMode, primitives: PrimitivePalett
199181 tertiary : darken ( p . background , 0.1 ) ,
200182 elevated : p . background ,
201183 overlay : alpha ( p . background , 0.8 ) ,
184+
202185 tint : `linear-gradient(90deg, ${ alpha ( p . secondary , 0.8 ) } 0%, ${ p . secondary } 100%)` ,
203186 inverse : p . foreground ,
204187 } ,
@@ -213,7 +196,7 @@ export const createCustomTheme = (mode: PaletteMode, primitives: PrimitivePalett
213196 } ,
214197
215198 navigation : {
216- primary : p . NavigationBar ,
199+ primary : p . navigationBar ,
217200 secondary : p . secondary ,
218201 active : p . primary ,
219202 hover : alpha ( p . primary , 0.85 ) ,
@@ -271,7 +254,7 @@ export const createCustomTheme = (mode: PaletteMode, primitives: PrimitivePalett
271254
272255 surfaces : p . background ,
273256
274- appNavigationBar : p . NavigationBar ,
257+ appNavigationBar : p . navigationBar ,
275258 secondaryAppNavigationBar : p . secondary ,
276259
277260 } ,
0 commit comments