-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Adding react Text component to design-system-react #110
base: main
Are you sure you want to change the base?
Conversation
a95b14f
to
583f5de
Compare
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
@@ -15,7 +15,7 @@ module.exports = merge(baseConfig, { | |||
displayName, | |||
|
|||
// Add coverage ignore patterns | |||
coveragePathIgnorePatterns: ['index.ts'], | |||
coveragePathIgnorePatterns: ['index.ts', '.d.ts'], |
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.
"dependencies": { | ||
"tailwind-merge": "^2.0.0" | ||
}, |
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.
Tailwind merge is what portfolio uses to resolve tailwind classname conflicts and duplicates
https://github.com/dcastil/tailwind-merge
@@ -1,6 +1,6 @@ | |||
import React from 'react'; |
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.
I think I can improve the tests here so they can be more comphrehensive I've created a subsequent ticket which will thoroghly test all prop #119
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.
Improved test PR here #122
|
||
import { extendTailwindMerge } from 'tailwind-merge'; | ||
|
||
// TODO create a test that checks against typographyMap in Text.tsx |
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.
I will do this in #119
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.
Tests for twmerge util here #122
'font-weight': ['font-weight'], | ||
}, | ||
}, | ||
}); |
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.
We may want to export this as a utility so it can be used with our components, allowing us to avoid conflicts with our typography classnames, even though they are unlikely to be used. We can address this in a future PR if it becomes necessary.
f6521ac
to
eb6c674
Compare
@@ -1,4 +1,13 @@ | |||
export { Text, TextVariant } from './text'; |
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.
Exporting Text component and all types from component index
eb6c674
to
00c35a4
Compare
00c35a4
to
2c7a07e
Compare
@metamaskbot publish-preview |
Description
This PR adds a
Text
component to thedesign-system-react
library, introducing a reusable typography component for MetaMask’s design system.Related issues
Fixes: https://github.com/metamask/metamask-design-system/issues#workspaces/design-system-61e8a2ae77c3a60012e5003c/issues/zh/762
Manual testing steps
yarn storybook
Text
componentScreenshots/Recordings
After
after720.mov
100% test coverage
Pre-merge author checklist
Pre-merge reviewer checklist