feat: label component#907
Conversation
brianacnguyen
left a comment
There was a problem hiding this comment.
can you attach a screen recording to the PR?
|
@brianacnguyen done 🙌 |
brianacnguyen
left a comment
There was a problem hiding this comment.
can you remove the default const?
8d4ef72 to
93935a3
Compare
There was a problem hiding this comment.
Can we remove this image in a follow up PR they tend to become out of date
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| children: 'Sample Label Text', |
There was a problem hiding this comment.
non-blocking: We should ensure that all of our content follows our content guidelines and is sentenced case
| const { getByTestId } = render( | ||
| <Label testID="label">Sample Label Text</Label>, | ||
| ); | ||
| expect(getByTestId('label')).toBeDefined(); |
There was a problem hiding this comment.
non-blocking: Let's use toBeOnScreen moving forward to align with mobile unit test best practice
| ### `variant` | ||
|
|
||
| Optional enum to select between typography variants. The Label defaults to `TextVariant.BodyMd`. | ||
|
|
||
| | TYPE | REQUIRED | DEFAULT | | ||
| | ------------- | -------- | -------------------- | | ||
| | `TextVariant` | No | `TextVariant.BodyMd` | | ||
|
|
||
| ```tsx | ||
| import { Label } from '@metamask/design-system-react-native'; | ||
| import { TextVariant } from '@metamask/design-system-react-native'; | ||
|
|
||
| <Label variant={TextVariant.BodySm}>Small Label</Label> | ||
| <Label>Default Label (BodyMd)</Label> | ||
| ``` |
There was a problem hiding this comment.
non-blocking: we should think about if it makes sense to document this prop or would we prefer that the labels are keep consistent across the app in terms of font size/weight etc
93935a3 to
b5f64ee
Compare
## Summary Reverts the failed Release 20.0.0 (#921) to redo it properly with complete changelogs and correct yarn.lock. ## Context Release 20.0.0 was merged to main but the publish workflow failed due to a yarn.lock issue: - **Failed workflow:** https://github.com/MetaMask/metamask-design-system/actions/runs/22198282954 - **Root cause:** yarn.lock not updated when peer dependency changed After the release was merged, 7 additional PRs were merged to main: 1. Label component (#907) 2. HeaderBase component (#902) 3. Skeleton (#891) 4. Card (#923) 5. BottomSheetFooter (#899) 6. Toast (#892) 7. Input component (#909) ## Why Revert? To maintain clean version history and proper changelogs: - Release 20.0.0 was never published to NPM (latest is 19.0.0) - The 7 PRs merged after are not documented in Release 20.0.0 changelog - Reverting allows us to create a proper Release 20.0.0 that includes ALL changes ## Changes This PR reverts commit `45004196` which: - Restores package versions to pre-release state (8.1.1, 0.7.0, 0.6.0, etc.) - Restores root package.json version from 20.0.0 to 19.0.0 - Removes Release 20.0.0 changelog entries ## Next Steps After this is merged: 1. Create new `release/20.0.0` branch using standard release process 2. Include all changes (original + 7 PRs) in changelogs 3. **Run `yarn install` to update yarn.lock** 4. Merge new Release 20.0.0 PR 5. Publish workflow will succeed with correct lockfile 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Description
Added
Labelcomponent aligning it with this repo guidelines.Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-276
Manual testing steps
LabelexampleScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Additive UI component and exports with minimal logic; main risk is minor API surface/packaging or Storybook registration issues.
Overview
Adds a new
Labelcomponent that wrapsTextand defaults toTextVariant.BodyMd, withLabelPropsaliased toTextProps.Exposes
Labelfrom the design-system component barrel (components/index.ts), adds a Storybook story (and updates the auto-generatedstorybook.requires.js), includes basic render tests, and provides component documentation inLabel/README.md.Written by Cursor Bugbot for commit b5f64ee. This will update automatically on new commits. Configure here.