-
Notifications
You must be signed in to change notification settings - Fork 628
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 <[email protected]>
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 <[email protected]>
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
size
prop toActionListLinkItemProps
type definition - Pass the
size
prop through to the underlyingItem
component - 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 |
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
size
prop toActionList.LinkItem
to match the functionality shipped toActionList.Item
in https://github.com/github/primer/issues/4587.Problem
In @github/github/pull/393559, a
size
prop was added toActionList.Item
that defaults tomedium
but acceptslarge
. However,ActionList.LinkItem
did not have this same capability, creating an inconsistency between the two components.Solution
Added the
size
prop toActionList.LinkItem
using the same prop naming and styles asActionList.Item
:'size'
to theActionListLinkItemProps
Pick typesize
prop through to the underlyingItem
component'medium'
(same asActionList.Item
)'medium' | 'large'
Usage
Technical Details
The implementation leverages the existing infrastructure:
data-size
attribute that applies&[data-size='large']
for larger paddingItem
component's size handling mechanismActionList.Item
behaviorTesting
data-size
attribute is correctly appliedThis change ensures feature parity between
ActionList.Item
andActionList.LinkItem
while 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.