-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Organize files under
src/foundations/
(#9157)
Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>
- Loading branch information
1 parent
eb16b1a
commit 0eb1b76
Showing
12 changed files
with
138 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import createBreakpoints from '@mui/system/createTheme/createBreakpoints'; | ||
|
||
export const breakpoints = createBreakpoints({ | ||
values: { | ||
xs: 0, | ||
sm: 600, | ||
md: 960, | ||
lg: 1280, | ||
xl: 1920, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const latoWeb = { | ||
normal: '"LatoWeb", sans-serif', | ||
semiBold: '"LatoWebSemibold", sans-serif', | ||
bold: '"LatoWebBold", sans-serif', | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { createTheme } from '@mui/material/styles'; | ||
import _merge from 'lodash/merge'; | ||
|
||
// Themes & Brands | ||
import { darkTheme } from 'src/foundations/themes/dark'; | ||
import { lightTheme } from 'src/foundations/themes/light'; | ||
|
||
// Types & Interfaces | ||
import { customDarkModeOptions } from 'src/foundations/themes/dark'; | ||
import { latoWeb } from 'src/foundations/fonts'; | ||
import { | ||
color, | ||
bg, | ||
textColors, | ||
borderColors, | ||
} from 'src/foundations/themes/light'; | ||
|
||
export type ThemeName = 'light' | 'dark'; | ||
|
||
type Fonts = typeof latoWeb; | ||
|
||
type MergeTypes<A, B> = Omit<A, keyof B> & | ||
Omit<B, keyof A> & | ||
{ [K in keyof A & keyof B]: A[K] | B[K] }; | ||
|
||
type LightModeColors = typeof color; | ||
type DarkModeColors = typeof customDarkModeOptions.color; | ||
|
||
type Colors = MergeTypes<LightModeColors, DarkModeColors>; | ||
|
||
type LightModeBgColors = typeof bg; | ||
type DarkModeBgColors = typeof customDarkModeOptions.bg; | ||
|
||
type BgColors = MergeTypes<LightModeBgColors, DarkModeBgColors>; | ||
|
||
type LightModeTextColors = typeof textColors; | ||
type DarkModeTextColors = typeof customDarkModeOptions.textColors; | ||
type TextColors = MergeTypes<LightModeTextColors, DarkModeTextColors>; | ||
|
||
type LightModeBorderColors = typeof borderColors; | ||
type DarkModeBorderColors = typeof customDarkModeOptions.borderColors; | ||
|
||
type BorderColors = MergeTypes<LightModeBorderColors, DarkModeBorderColors>; | ||
|
||
/** | ||
* Augmenting the Theme and ThemeOptions. | ||
* This allows us to add custom fields to the theme. | ||
* Avoid doing this unless you have a good reason. | ||
*/ | ||
declare module '@mui/material/styles/createTheme' { | ||
interface Theme { | ||
name: ThemeName; | ||
bg: BgColors; | ||
color: Colors; | ||
textColors: TextColors; | ||
borderColors: BorderColors; | ||
font: Fonts; | ||
graphs: any; | ||
visually: any; | ||
animateCircleIcon?: any; | ||
addCircleHoverEffect?: any; | ||
applyLinkStyles?: any; | ||
applyStatusPillStyles?: any; | ||
applyTableHeaderStyles?: any; | ||
} | ||
|
||
interface ThemeOptions { | ||
name: ThemeName; | ||
bg?: LightModeBgColors | DarkModeBgColors; | ||
color?: LightModeColors | DarkModeColors; | ||
textColors?: LightModeTextColors | DarkModeTextColors; | ||
borderColors?: LightModeBorderColors | DarkModeBorderColors; | ||
font?: Fonts; | ||
graphs?: any; | ||
visually?: any; | ||
animateCircleIcon?: any; | ||
addCircleHoverEffect?: any; | ||
applyLinkStyles?: any; | ||
applyStatusPillStyles?: any; | ||
applyTableHeaderStyles?: any; | ||
} | ||
} | ||
|
||
export const light = createTheme(lightTheme); | ||
export const dark = createTheme(_merge(lightTheme, darkTheme)); |
Oops, something went wrong.