Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@primer/[email protected]
Major Changes
#1910
e1e8d478Thanks @colebemis! -ActionList2exported types are now prefixed withActionList:ActionMenu2exported types are now prefixed withActionMenu:#1910
e1e8d478Thanks @colebemis! -ActionList
ActionList has been rewritten with a composable API, design updates and accessibility fixes.
See full list of props and examples: https://primer.style/react/ActionList
To continue to use the deprecated API for now, change the import path to
@primer/react/deprecated:You can use the one-time codemod to change your import statements automatically.
#1910
e1e8d478Thanks @colebemis! -ActionMenu
ActionMenu has been rewritten with a composable API, design updates and accessibility fixes.
See full list of props and examples: https://primer.style/react/ActionMenu
Main changes:
itemsprop, useActionListinsideActionMenuanchorContentonActionMenu, useActionMenu.ButtonwithchildrenonActionprop onActionMenu, useonSelectprop onActionList.ItemgroupMetadataonActionMenu, useActionList.GroupoverlayPropsonActionMenu, useActionMenu.OverlayTo continue to use the deprecated API for now, change the import path to
@primer/react/deprecated:You can use the one-time codemod to change your import statements automatically.
#1910
e1e8d478Thanks @colebemis! -DropdownMenu
DropdownMenu has been deprecated in favor of ActionMenu with ActionList
See example with selection: https://primer.style/react/ActionMenu#with-selection
Migration guide:
itemsprop, useActionListinsideActionMenuselectionVariant="single"onActionListto set the right semantics for selectionselectedItemprop, useselectedprop onActionList.ItemrenderAnchorandplaceholderprops onDropdownMenu, useActionMenu.ButtonorActionMenu.AnchoronChangeprop onDropdownMenu, useonSelectprop onActionList.ItemgroupMetadataonDropdownMenu, useActionList.GroupoverlayPropsonDropdownMenu, useActionMenu.OverlayTo continue to use the deprecated API for now, change the import path to
@primer/react/deprecated:You can use the one-time codemod to change your import statements automatically.
drafts/DropdownMenu2
DropdownMenu2 has been removed in favor of ActionMenu with ActionList
#1910
e1e8d478Thanks @colebemis! -Label
The Label component's API and visual design have been updated to be consistent with its counterpart in Primer ViewComponents' Label component.
Major changes in the new Label component:
mediumsize - onlysmallandlargeoutlineprop has been removedsxpropIf you were using the
Labelcomponent to render issue/PR labels, use the IssueLabelToken component instead.To continue to use the deprecated API for now, change the import path to
@primer/react/deprecated:You can use the one-time codemod to change your import statements automatically.
#1910
e1e8d478Thanks @colebemis! -Button
Before
v35,Buttonwas a set of seven independent components. Inv35, we've simplified theButtonAPI.Button variants
We now support a variant property which takes values
primary,invisible,outlineanddangerLeading and trailing icons
Previously including icons inside buttons required a lot of custom styling. In the new
Buttoncomponent, we now support first-classleadingIconandtrailingIconprops:Icon buttons
Icon-only buttons are common in many applications. We now have a component designed for this use-case:
Size property
Previously, we used a
variantprop to set the size of buttons. We now have a prop calledsizewhich is more semantically correct.#1910
e1e8d478Thanks @colebemis! -ChoiceFieldset
The
CheckboxGroupandRadioGroupcomponents are replacing theChoiceFieldsetcomponent.CheckboxGroupandRadioGrouphave the ability to render contextual content with your fieldset: labels, validation statuses, captions. They also handle the ARIA attributes that make the form controls accessible to assistive technology.To continue to use the deprecated API for now, change the import path to
@primer/react/deprecated:You can use the one-time codemod to change your import statements automatically.
#1910
e1e8d478Thanks @colebemis! -PageLayout
PageLayoutis being graduated from thedraftsbundle to themainbundle.To upgrade, rewrite your imports accordingly:
#1910
e1e8d478Thanks @colebemis! -FormGroup, InputField, ChoiceInputField
The
FormControlcomponent is replacing theFormGroup,InputField, andChoiceInputFieldcomponents. It has the ability to render contextual content with your inputs: labels, validation statuses, captions. It also handles the ARIA attributes that make the form controls accessible to assistive technology.To continue to use the deprecated API for now, change the import path to
@primer/react/deprecated:You can use the one-time codemod to change your import statements automatically.
#1910
e1e8d478Thanks @colebemis! -SelectMenu
SelectMenuhas been deprecated. Please useActionMenuinstead.See https://primer.style/react/ActionMenu for more migration examples.
Dropdown
Dropdownhas been deprecated. Please useActionMenuinstead.See https://primer.style/react/ActionMenu for more migration examples.
Flex
Flexhas been deprecated. Please useBoxinstead.Grid
Gridhas been deprecated. Please useBoxinstead.BorderBox
BorderBoxhas been deprecated. Please useBoxinstead.Position
Positionhas been deprecated. Please useBoxinstead.Minor Changes
e1e8d478Thanks @colebemis! - Add align prop on ActionMenu.Overlay to pass through to AnchoredOverlayPatch Changes
#1910
e1e8d478Thanks @colebemis! - ActionMenu.Button: Fix spacing between text and caret#1910
e1e8d478Thanks @colebemis! - - Update styles for default variant of Button's active state#1910
e1e8d478Thanks @colebemis! - Surfaced the following components and hooks from the root index:These exports can now be imported from the root index, rather than from their nested subfolders.
E.g.