-
Notifications
You must be signed in to change notification settings - Fork 0
refactor!: refactor typography.ts - limit public surface area (#422) #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors typography usage by replacing hardcoded styles with centralized constants to improve consistency, maintainability, and readability across the codebase.
- Replaces deprecated typography variants and mixins with standardized constants (TYPOGRAPHY_PROPS and FONT).
- Consolidates typography-related imports and updates class names in CSS-in-JS styles.
- Removes deprecated mixins to limit the public surface area of the typography module.
Reviewed Changes
Copilot reviewed 98 out of 98 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
variableSizeListItem.tsx | Updated typography variant to use TYPOGRAPHY_PROPS.VARIANT.BODY_SMALL_400. |
filters.styles.ts | Replaced legacy font mixins with FONT constants for body and uppercase text. |
filterRange.styles.ts | Updated typography for input label using FONT constants. |
filterNoResultsFound.tsx | Standardized typography variants to use TYPOGRAPHY_PROPS. |
filterMenu.styles.ts | Updated typography in button styles to use FONT constants. |
export.styles.ts | Replaced legacy typography mixins with FONT constants for small body text. |
manifestDownloadEntity.styles.ts | Updated section title typography to use FONT constants. |
terraSetUpForm.tsx/.styles.ts | Standardized typography variants to use centralized constants. |
formStep.tsx/.styles.ts | Updated typography variants and corresponding CSS class names. |
exportSummary.styles.ts | Replaced legacy font mixins with FONT constants for consistency. |
exportMethod.tsx/.styles.ts | Updated typography to use standardized constants. |
exportForm.styles.ts | Standardized typography in form controls using FONT constants. |
error.tsx/.styles.ts | Updated error component typography to use TYPOGRAPHY_PROPS and FONT constants. |
DataDictionary Tooltip & Entity files | Refactored typography references to use centralized constants. |
Comments suppressed due to low confidence (1)
src/components/DataDictionary/components/Tooltip/components/Title/title.tsx:3
- [nitpick] Using the alias 'MUI_TYPOGRAPHY_PROPS' alongside another import named 'TYPOGRAPHY_PROPS' from a different module may lead to confusion. Consider renaming one of them to maintain naming consistency throughout the file.
import { TYPOGRAPHY_PROPS as MUI_TYPOGRAPHY_PROPS } from "../../../../../../styles/common/mui/typography";
215a4c2
to
a7cb0c4
Compare
a7cb0c4
to
e89fe4d
Compare
Closes #422.
This pull request focuses on standardizing typography usage across the codebase by replacing hardcoded typography styles and mixins with centralized constants. It also introduces consistent imports for typography properties and font definitions, improving maintainability and readability.
Typography Standardization
Replaced hardcoded typography variants (e.g.,
text-body-large-500
,text-body-400-2lines
) with centralized constants fromTYPOGRAPHY_PROPS
in components likeEntity
,Error
,ExportMethod
, andFilterNoResultsFound
. [1] [2] [3] [4]Updated typography mixins (e.g.,
textBodyLarge500
,textBody4002Lines
) to useFONT
constants for font properties in style files such aserror.styles.ts
,exportForm.styles.ts
, andfilterMenu.styles.ts
. [1] [2] [3]Import Consolidation
TYPOGRAPHY_PROPS
andFONT
constants in various components and styles. [1] [2] [3] [4]ClassName Adjustments
.MuiTypography-text-body-400-2lines
to.MuiTypography-body-400-2lines
). [1] [2]Removal of Deprecated Mixins
textBody4002Lines
andtextBodyLarge500
from various style files, replacing them with standardizedFONT
constants. [1] [2]Improved Maintainability