Skip to content

Commit 9b9b690

Browse files
authored
Merge pull request #1136 from saurabhraghuvanshii/lint
lint the file
2 parents f548d8d + 3063d3d commit 9b9b690

File tree

6 files changed

+370
-379
lines changed

6 files changed

+370
-379
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,5 @@ This repository and site are available as open source under the terms of the [Ap
148148
<p>The <a href="https://layer5.io/community">Layer5 community</a> represents the largest collection of service mesh projects and their maintainers in the world.</p>
149149

150150
**Open Source First**
151+
151152
<p>At Layer5, we champion developer-defined infrastructure, giving engineers the power to reshape application delivery. We empower operators in reimagining how they manage modern infrastructure: collaboratively.</p>

src/custom/Modal/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { ContainedButton, OutlinedButton, TextButton } from '../../base/Button/B
55
import { iconLarge } from '../../constants/iconsSizes';
66
import { CloseIcon, FullScreenIcon } from '../../icons';
77
import FullScreenExitIcon from '../../icons/Fullscreen/FullScreenExitIcon';
8-
import { darkModalGradient, lightModalGradient } from '../../theme/colors/colors';
98
import { CustomTooltip } from '../CustomTooltip';
109
import { HelperTextPopover } from '../HelperTextPopover';
1110

@@ -132,10 +131,7 @@ export const ModalBody = styled(Paper)(({ theme }) => ({
132131
const StyledFooter = styled('div', {
133132
shouldForwardProp: (prop) => prop !== 'variant'
134133
})<ModalFooterProps>(({ theme, variant, hasHelpText }) => ({
135-
background:
136-
variant === 'filled'
137-
? (theme.palette.surface.tint)
138-
: 'transparent',
134+
background: variant === 'filled' ? theme.palette.surface.tint : 'transparent',
139135
display: 'flex',
140136
alignItems: 'center',
141137
justifyContent: hasHelpText ? 'space-between' : 'end',
@@ -175,7 +171,7 @@ export const Modal: React.FC<ModalProps> = ({
175171
{...props}
176172
>
177173
{title && (
178-
<ModalStyledHeader className='modal-header' data-testid="modal-header">
174+
<ModalStyledHeader className="modal-header" data-testid="modal-header">
179175
{headerIcon && <Box data-testid="modal-header-icon">{headerIcon}</Box>}
180176
<Typography component={'div'} variant="h6" data-testid="modal-title">
181177
{title}
@@ -199,7 +195,11 @@ export const Modal: React.FC<ModalProps> = ({
199195
)}
200196
</CustomTooltip>
201197
)}
202-
<CloseBtn onClick={closeModal} className='modal-close-btn' data-testid="modal-close-btn">
198+
<CloseBtn
199+
onClick={closeModal}
200+
className="modal-close-btn"
201+
data-testid="modal-close-btn"
202+
>
203203
<CloseIcon {...iconLarge} fill="#fff"></CloseIcon>
204204
</CloseBtn>
205205
</div>
@@ -214,7 +214,7 @@ export const Modal: React.FC<ModalProps> = ({
214214

215215
export const ModalFooter: React.FC<ModalFooterProps> = ({ helpText, children, variant }) => {
216216
return (
217-
<StyledFooter className='modal-footer' variant={variant} hasHelpText={!!helpText}>
217+
<StyledFooter className="modal-footer" variant={variant} hasHelpText={!!helpText}>
218218
{helpText && (
219219
// <CustomTooltip title={helpText} variant="standard" placement="top">
220220
// <IconButton>

src/theme/ThemeProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { EmotionCache } from '@emotion/react';
2-
import { CssBaseline, PaletteMode, Theme, ThemeProvider } from '@mui/material';
2+
import { CssBaseline, PaletteMode, Theme, ThemeProvider } from '@mui/material';
33
import React from 'react';
4-
import { createCustomTheme,PrimitivePalette } from './theme';
4+
import { createCustomTheme, PrimitivePalette } from './theme';
55

66
interface SistentProviderContextType {
77
emotionCache?: EmotionCache;
@@ -23,7 +23,7 @@ function SistentThemeProvider({
2323
customTheme
2424
}: SistentThemeProviderProps): JSX.Element {
2525
const theme = React.useMemo<Theme>(
26-
() => createCustomTheme(initialMode, customTheme ),
26+
() => createCustomTheme(initialMode, customTheme),
2727
[initialMode, customTheme]
2828
);
2929
return (

src/theme/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ import {
99
useMediaQuery,
1010
useTheme
1111
} from '@mui/material';
12-
export { darkModePalette, lightModePalette } from './palette';
13-
export { typography } from './typography';
14-
export {type PrimitivePalette,SistentDefaultPrimitivePaletteDark,SistentDefaultPrimitivePaletteLight} from "./theme";
1512
export * from './colors';
13+
export { darkModePalette, lightModePalette } from './palette';
14+
export {
15+
SistentDefaultPrimitivePaletteDark,
16+
SistentDefaultPrimitivePaletteLight,
17+
type PrimitivePalette
18+
} from './theme';
1619
export {
1720
default as SistentThemeProvider,
1821
SistentThemeProviderWithoutBaseLine
1922
} from './ThemeProvider';
23+
export { typography } from './typography';
2024

2125
export { ThemeProvider, alpha, createTheme, keyframes, lighten, styled, useMediaQuery, useTheme };
2226
export type { Theme };

src/theme/palette.ts

Lines changed: 102 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -170,70 +170,68 @@ declare module '@mui/material/styles' {
170170
};
171171
};
172172
}
173-
174-
// surface tokens need to have enough contrast
175-
// with text and interactive elements
176-
type SurfaceTokens = {
177-
178-
/** main page background, content containers (pure bg color) */
179-
primary: string;
180-
181-
/** secondary surfaces (slightly darker bg) */
182-
secondary: string;
183-
184-
/** tertiary surfaces (even darker bg) */
185-
tertiary: string;
186-
187-
/** floating elements with depth (bg + shadow) */
188-
elevated: string;
189-
190-
/** modal backdrops (semi-transparent bg) */
191-
overlay: string;
192-
193-
/** highlight surfaces (eg. modal headers , tabs, ) */
194-
tint: string;
195-
196-
/** high contrast alternative (fg as bg) */
197-
inverse: string;
198-
}
199173

200-
type InteractiveTokens = {
201-
/** default interactive elements (primary color) */
202-
primary: string;
203-
204-
/** hover state for interactive elements (primary hover tint) */
205-
hover: string;
206-
207-
/** disabled state for interactive elements (primary disabled tint) */
208-
disabled?: string;
209-
210-
/** pressed state for interactive elements (primary pressed tint) */
211-
pressed: string;
212-
213-
/** secondary interactive elements (secondary color) */
214-
secondary: string;
215-
216-
/** tertiary interactive elements (tertiary color) */
217-
tertiary: string;
218-
};
174+
// surface tokens need to have enough contrast
175+
// with text and interactive elements
176+
type SurfaceTokens = {
177+
/** main page background, content containers (pure bg color) */
178+
primary: string;
219179

220-
type NavigationTokens = {
221-
/** main navigation bar background */
222-
primary: string;
223-
224-
/** secondary navigation bar background */
225-
secondary: string;
180+
/** secondary surfaces (slightly darker bg) */
181+
secondary: string;
226182

227-
/** active navigation item background */
228-
active: string;
183+
/** tertiary surfaces (even darker bg) */
184+
tertiary: string;
229185

230-
/** hover state for navigation items */
231-
hover: string;
232-
};
186+
/** floating elements with depth (bg + shadow) */
187+
elevated: string;
188+
189+
/** modal backdrops (semi-transparent bg) */
190+
overlay: string;
191+
192+
/** highlight surfaces (eg. modal headers , tabs, ) */
193+
tint: string;
194+
195+
/** high contrast alternative (fg as bg) */
196+
inverse: string;
197+
};
198+
199+
type InteractiveTokens = {
200+
/** default interactive elements (primary color) */
201+
primary: string;
202+
203+
/** hover state for interactive elements (primary hover tint) */
204+
hover: string;
205+
206+
/** disabled state for interactive elements (primary disabled tint) */
207+
disabled?: string;
208+
209+
/** pressed state for interactive elements (primary pressed tint) */
210+
pressed: string;
211+
212+
/** secondary interactive elements (secondary color) */
213+
secondary: string;
214+
215+
/** tertiary interactive elements (tertiary color) */
216+
tertiary: string;
217+
};
218+
219+
type NavigationTokens = {
220+
/** main navigation bar background */
221+
primary: string;
222+
223+
/** secondary navigation bar background */
224+
secondary: string;
225+
226+
/** active navigation item background */
227+
active: string;
228+
229+
/** hover state for navigation items */
230+
hover: string;
231+
};
233232

234233
// Defines the options available for the palette.
235234
interface PaletteOptions {
236-
237235
surface: SurfaceTokens;
238236
interactive: InteractiveTokens;
239237
navigation: NavigationTokens;
@@ -266,37 +264,34 @@ type NavigationTokens = {
266264
}
267265
}
268266

269-
export type ThemePalette = PaletteOptions
270-
271-
267+
export type ThemePalette = PaletteOptions;
272268

273269
export const lightModePalette: PaletteOptions = {
270+
surface: {
271+
primary: Colors.charcoal[100],
272+
secondary: Colors.charcoal[90],
273+
tertiary: Colors.charcoal[80],
274+
elevated: Colors.WHITE,
275+
overlay: alpha(Colors.charcoal[90], 0.8),
276+
inverse: Colors.charcoal[10],
277+
tint: `linear-gradient(90deg, ${Colors.TEAL_BLUE} 0%, ${Colors.DARK_TEAL} 100%)`
278+
},
274279

275-
surface: {
276-
primary: Colors.charcoal[100],
277-
secondary: Colors.charcoal[90],
278-
tertiary: Colors.charcoal[80],
279-
elevated: Colors.WHITE,
280-
overlay: alpha(Colors.charcoal[90], 0.8),
281-
inverse: Colors.charcoal[10],
282-
tint: `linear-gradient(90deg, ${Colors.TEAL_BLUE} 0%, ${Colors.DARK_TEAL} 100%)`
283-
} ,
284-
285-
interactive: {
286-
primary: Colors.KEPPEL,
287-
hover: Colors.keppel[50],
288-
disabled: Colors.charcoal[90],
289-
pressed: Colors.keppel[60],
290-
secondary: Colors.keppel[40],
291-
tertiary: Colors.keppel[70]
292-
},
280+
interactive: {
281+
primary: Colors.KEPPEL,
282+
hover: Colors.keppel[50],
283+
disabled: Colors.charcoal[90],
284+
pressed: Colors.keppel[60],
285+
secondary: Colors.keppel[40],
286+
tertiary: Colors.keppel[70]
287+
},
293288

294-
navigation: {
295-
primary: "#252e31",
296-
secondary: "#294957",
297-
active: Colors.KEPPEL,
298-
hover: Colors.keppel[50]
299-
},
289+
navigation: {
290+
primary: '#252e31',
291+
secondary: '#294957',
292+
active: Colors.KEPPEL,
293+
hover: Colors.keppel[50]
294+
},
300295

301296
primary: {
302297
main: Colors.KEPPEL
@@ -425,31 +420,30 @@ export const lightModePalette: PaletteOptions = {
425420
};
426421

427422
export const darkModePalette: PaletteOptions = {
423+
surface: {
424+
primary: Colors.charcoal[10],
425+
secondary: Colors.charcoal[20],
426+
tertiary: Colors.charcoal[30],
427+
elevated: Colors.charcoal[40],
428+
overlay: alpha(Colors.charcoal[20], 0.8),
429+
inverse: Colors.WHITE,
430+
tint: `linear-gradient(90deg, ${Colors.charcoal[30]} 0%, ${Colors.accentGrey[30]} 100%)`
431+
},
432+
interactive: {
433+
primary: Colors.KEPPEL,
434+
hover: Colors.keppel[50],
435+
disabled: Colors.charcoal[30],
436+
pressed: Colors.keppel[60],
437+
secondary: Colors.keppel[20],
438+
tertiary: Colors.keppel[10]
439+
},
428440

429-
surface: {
430-
primary: Colors.charcoal[10],
431-
secondary: Colors.charcoal[20],
432-
tertiary: Colors.charcoal[30],
433-
elevated: Colors.charcoal[40],
434-
overlay: alpha(Colors.charcoal[20], 0.8),
435-
inverse: Colors.WHITE,
436-
tint: `linear-gradient(90deg, ${Colors.charcoal[30]} 0%, ${Colors.accentGrey[30]} 100%)`,
437-
},
438-
interactive: {
439-
primary: Colors.KEPPEL,
440-
hover: Colors.keppel[50],
441-
disabled: Colors.charcoal[30],
442-
pressed: Colors.keppel[60],
443-
secondary: Colors.keppel[20],
444-
tertiary: Colors.keppel[10]
445-
},
446-
447-
navigation: {
448-
primary: Colors.charcoal[10],
449-
secondary: Colors.charcoal[20],
450-
active: Colors.KEPPEL,
451-
hover: Colors.keppel[50]
452-
},
441+
navigation: {
442+
primary: Colors.charcoal[10],
443+
secondary: Colors.charcoal[20],
444+
active: Colors.KEPPEL,
445+
hover: Colors.keppel[50]
446+
},
453447

454448
primary: {
455449
main: Colors.KEPPEL

0 commit comments

Comments
 (0)