Releases: primer/react
v19.0.0
In addition to the changes below, this release also features a new and improved Getting Started guide.
🚨 Breaking Changes
-
Removed "Segoe UI Symbol" from font stack as it is not compatible with Chinese characters #769 @skw
-
BorderBoxhas had its defaultborderprop split intoborderWidthandborderStyle:before:
BorderBox.defaultProps = { border: '1px solid', borderColor: 'gray.2', borderRadius: 2 }
after:
BorderBox.defaultProps = { borderWidth: '1px', borderStyle: 'solid', borderColor: 'gray.2', borderRadius: 2 }
While this change was made to fix bugs in the ability to modify
BorderBox's border, it is also a breaking change if you useborderorborder<Direction>shorthand props to modify the border, as these will no longer work. Instead, use non-shorthand props. For example, change<BorderBox border={0} borderTop={1}>...</BorderBox>
to
<BorderBox borderWidth={0} borderTopWidth={1}>...</BorderBox>
-
Flexnow behaves exactly likeBoxexcept that it has itsdisplayprop set toflexby default #761 @BinaryMuse -
Flex.Item, previously deprecated, has been removed in favor ofBox, which now has all the same props #761 @BinaryMuse -
theme.bordershas been removed; use the newborderWidthstheme values forborderWidthproperties (0is a width of0,1is a width of1px) #761 @BinaryMuse
🚫 Deprecations
Starting this version, we will be adding a deprecation period for breaking API changes whenever possible. When using a deprecated feature, you will see a warning in the JavaScript console that details how you should change your usage as well as the version at which we plan to remove the deprecated feature.
-
The
Flashcomponent'sschemeprop has been deprecated in favor of a newvariantprop. We plan to remove theschemeprop in version 20.To migrate:
Change
scheme='blue'to▶️ variant='default'
Changescheme='green'to▶️ variant='success'
Changescheme='red'to▶️ variant='danger'
Changescheme='yellow'to▶️ variant='warning' -
StateLabel'ssmallprop is deprecated in favor of a newvariantprop. Usevariant="small"to achieve the same result. We plan to remove thesmallprop in version 20. #798 #752 @tiaanduplessis @BinaryMuse
💅 Enhancements
-
Box(and components that inherit from it, likeBorderBox) now have access toFLEXsystem props #761 @BinaryMuse -
Positionand its family members (Relative,Absolute,Sticky, andFixed) now inherit fromBoxand receiveFLEXsystem props. -
A new prop,
sx, has been added to all components to allow theme-aware ad-hoc styles. See the prop's documentation for more information. #755 @BinaryMuse -
Each component can now be imported individually, without importing all of Primer Components. For example,
import Box from '@primer/components/lib/Box'. Users using an ESM-compatible module bundler should not use this import style. See the usage docs for more information. #789 @BinaryMuse -
The following colors have been added:
- border.blackFade
- border.blue
- border.blueLight
- border.grayDarker
- border.green
- border.greenLight
- border.purple
- border.red
- border.redLight
- border.white
- border.whiteFade
- border.yellow
-
Allow
SelectMenu.Itemto beaorbutton#787 -
SelectMenu.Modalhas a new propertyalign; setalign='right'to right-align the modal @dmarcey #800
🐛 Bug Fixes
- Typo fix #783 @andrewhillcode
- Add
text-alignto buttons #772 @albingroen
v18.1.0
v18.0.0
🔨 Breaking changes
Some breaking changes that were meant to be included in v17.0.0 were mistakenly absent. Those changes are included in this release, and the v17.0.0 release notes have been edited to reflect the changes included in that release. Big thanks to @acknosyn for catching and fixing this. (#757, #758)
-
Dialogcomponents no longer render with a header by default. #736 @BinaryMuseMigration strategy: change any
Dialogcomponent with atitleprop set as follows:<Dialog title="...title..."> ...content... </Dialog>
to
<Dialog> <Dialog.Header>...title...</Dialog.Header> ...content... </Dialog>
-
Headingnow renders anh2by default instead of anh1#716 @taylorcjohnsonMigration strategy: change any use of the
Headingcomponent without anasprop:<Heading>...</Heading>
to
<Heading as="h1">...</Heading>
🐛 Bug Fixes
- Update box shadow to match Primer CSS Next #732 @colebemis
v17.1.1
v17.1.0
v17.0.0
🔧 Breaking changes
-
Dropdown elements no longer provide a Dropdown button by default - this allows users to pass in any type of
summaryelement so the component can work well for different types of dropdowns #729.Migration strategy: change any
Dropdowncomponent with atitleprop set as follows:<Dropdown title="hello world"> <Dropdown.Menu> <Dropdown.Item>Item 1</Dropdown.Item> <Dropdown.Item>Item 2</Dropdown.Item> <Dropdown.Item>Item 3</Dropdown.Item> </Dropdown.Menu> </Dropdown>
to
<Dropdown title="hello world"> <Dropdown.Button>Hello world</Dropdown.Button> <Dropdown.Menu> <Dropdown.Item>Item 1</Dropdown.Item> <Dropdown.Item>Item 2</Dropdown.Item> <Dropdown.Item>Item 3</Dropdown.Item> </Dropdown.Menu> </Dropdown>
We've also added the ability to manage the
openstate and provide custom handles foronToggleandonOutsideClickto theDetailscomponent andDropdowncomponent for more flexibility and reusability 🎉 🙌
✨ New Components
🐛 Bug Fixes
v16.3.0
🐛 Bug fixes
- Fix DropdownProps type intersections #725 @clayplumridge
- Add
classNameandcssto BaseProps TypeScript type #726 @BinaryMuse - Update UnderlineNav.Link prop type #727 @emplums
- Let 'TextInput' use 'maxWidth' and 'minWidth' from 'styled-system' #723 @smockle
💅 New components
- Add Popover component #703 @BinaryMuse
v16.2.0
v16.1.0
v16.0.0 Visual Refresh
This release contains changes for the Primer Visual Refresh ✨ There are no breaking changes, so upgrading to v16.0.0 should be fairly seamless.
Buttons
- Updated border radii
- Updated colors
- Updated box shadows
- Corrected padding on buttons
- Reorganized the theme file to store variables for buttons in a more organized manner
- Made sure all colors, bg, border colors, and box shadows pull from a button specific theme object instead of directly from the
colorshadowsetc objects in the theme. - Created a new internal
ButtonBasecomponent that all exported buttons are based on. This button has all the shared styles between the buttons, variant styles, anddisabledbehaviors. I did this so that we were not including the styles that are specific to our grey default Button in every other button component. Makes overriding styles more predictable and the internal API cleaner :)
UnderlineNav
- Use new orange color
- Remove bold from selected item
StateLabel
- Updated border radius
- Updated padding
- Updated line height
FilteredSearch
- Updated border radius
TextInput
- Updated border radius
- Updated disabled styles
- Fixed font size
- Updated left padding
- Updated border color
Dropdown
- Inherits updated Button styles
- Updated caret spacing
- Updated border radius of menu
Labels
- Updated padding
- Updated border radius
- Updated line heights
- Updated font sizes
- Made sure outline variant can use the
borderColorsystem prop. - Updated label documentation
BorderBox
- Updated default border radius
SubNav
- Updated border radius
TabNav
- Updated border radius
- Updated text colors
General System Changes:
- New
buttonobject in theme - New border radius value in theme
- Updated formControl values in theme