-
Notifications
You must be signed in to change notification settings - Fork 645
Add size prop to ActionList.LinkItem #6470
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
Add size prop to ActionList.LinkItem #6470
Conversation
🦋 Changeset detectedLatest commit: 8b57f29 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: dylanatsmith <6905903+dylanatsmith@users.noreply.github.com>
size prop to ActionList.Item so it can be medium by default but accept large.
Add the same thing to ActionList.LinkItem, using the same prop naming and styles.|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
|
@copilot Add a changeset |
size-limit report 📦
|
Co-authored-by: dylanatsmith <6905903+dylanatsmith@users.noreply.github.com>
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 adds a size prop to ActionList.LinkItem to achieve feature parity with ActionList.Item, which already has this functionality. The change allows LinkItem components to be rendered in either medium (default) or large sizes.
- Add
sizeprop toActionListLinkItemPropstype definition - Pass the
sizeprop through to the underlyingItemcomponent - Add comprehensive test coverage and Storybook controls
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/react/src/ActionList/LinkItem.tsx | Add size prop to type definition and component implementation |
| packages/react/src/ActionList/ActionList.test.tsx | Add test to verify size prop functionality and data-size attribute |
| packages/react/src/ActionList/ActionList.stories.tsx | Add size control to LinkItem Storybook playground |
| .changeset/add-actionlist-linkitem-size-prop.md | Add changeset entry documenting the new feature |
langermank
left a comment
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.
🚀
This PR adds the
sizeprop toActionList.LinkItemto match the functionality shipped toActionList.Itemin https://github.com/github/primer/issues/4587.Problem
In @github/github/pull/393559, a
sizeprop was added toActionList.Itemthat defaults tomediumbut acceptslarge. However,ActionList.LinkItemdid not have this same capability, creating an inconsistency between the two components.Solution
Added the
sizeprop toActionList.LinkItemusing the same prop naming and styles asActionList.Item:'size'to theActionListLinkItemPropsPick typesizeprop through to the underlyingItemcomponent'medium'(same asActionList.Item)'medium' | 'large'Usage
Technical Details
The implementation leverages the existing infrastructure:
data-sizeattribute that applies&[data-size='large']for larger paddingItemcomponent's size handling mechanismActionList.ItembehaviorTesting
data-sizeattribute is correctly appliedThis change ensures feature parity between
ActionList.ItemandActionList.LinkItemwhile maintaining the existing API and behavior.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.