Releases: primer/react
v35.6.0
Permalink to documentation
Minor Changes
- 
#2191 7edf1347Thanks @mperrotti! - Adds responsive behavior to SegmentedControl'sfullWidthprop.
- 
#2174 62dbc981Thanks @colebemis! - Add a responsivehiddenprop toPageLayout.Header,PageLayout.Pane,PageLayout.Content, andPageLayout.Footerthat allows you to hide layout regions based on the viewport width. Example usage:// Hide pane on narrow viewports <PageLayout.Pane hidden={{narrow: true}}>...</PageLayout.Pane> 
- 
#2199 fb385b63Thanks @colebemis! - * Updated thepositionprop inPageLayout.Paneto use the new responsive prop API introduced in #2174.- Deprecated the positionWhenNarrowprop in favor of the new responsive prop API
 Before position="start" positionWhenNarrow="end"After position={{regular: 'start', narrow: 'end'}}
- Deprecated the 
- 
#2201 885064edThanks @colebemis! - Addpaddingprop toPageLayout.Header,PageLayout.Content,PageLayout.Pane, andPageLayout.Footer
- 
#2164 2b5c86e5Thanks @mperrotti! - Adds support for a responsive 'variant' prop to the SegmentedControl component
- 
#2212 04d9d9c1Thanks @colebemis! - Add astickyprop to thePageLayout.Panecomponent that provides a convenient way for you to make side panes sticky:<PageLayout> - <PageLayout.Pane>...</PageLayout.Pane> + <PageLayout.Pane sticky>...</PageLayout.Pane> <PageLayout.Content>...</PageLayout.Content> </PageLayout> 
- 
#2198 4d9b7db9Thanks @colebemis! - * Updated thedividerprop inPageLayout.Header,PageLayout.Pane, andPageLayout.Footerto use the new responsive prop API introduced in #2174.- Deprecated the dividerWhenNarrowprop in favor of the new responsive prop API
 Before divider="line" dividerWhenNarrow="filled"After divider={{regular: 'line', narrow: 'filled'}}
- Deprecated the 
Patch Changes
- 
#2024 5321f1c9Thanks @siddharthkp! - ActionMenu: Remove focus trap to enable Tab and Shift+Tab behavior and fix initial focus on click
- 
#2186 e28aadbdThanks @mperrotti! - Updates SegmentedControl styles to use component primitives.
- 
#2171 384ae6b9Thanks @anleac! - Support issues closed as not planned, and correct the standard issue closed backgroud colour
- 
#2157 77e7ab05Thanks @iansan5653! - AddInlineAutocompletecomponent,useComboboxhook, anduseSyntheticChangehook to drafts
- 
#2189 35716587Thanks @mperrotti! - Makes SegmentedControl uncontrolled by default.
- 
#2196 5ff5bb81Thanks @mattcosta7! - update types to allow children for react 18
- 
#2219 af534f15Thanks @iansan5653! - Fix slots infinite rendering when nocontextprop is provided
- 
#2182 47725a92Thanks @iansan5653! - - AddMarkdownEditorandMarkdownViewerdraft components. TheMarkdownEditoris also known as theCommentBoxcomponent- Add useUnifiedFileSelect,useIgnoreKeyboardInputWhileComposing,useDynamicTextareaHeight, anduseSafeAsyncCallbackdraft hooks
 
- Add 
- 
#2173 ed609719Thanks @mperrotti! - Updates styles for the Select component so that the focus outline is even all the way around.
- 
#2216 82fd8c35Thanks @iansan5653! - ChangecreateSlotsto use layout effects when registering slots
- 
#2185 3756a1edThanks @mattcosta7! - Set ConfirmationDialog initial focus based on the confirmationButtonVariant. WhendangerautoFocus the cancel button, otherwise autoFocus the confirmation button
- 
#2166 75d21745Thanks @mattcosta7! - button should be polymorphic
- 
#2220 f4ef7b4bThanks @mperrotti! - - Fixesroleand keyboard behavior for SegmentedControl.- Fixes a bug where icon-only SegmentedControl buttons did not fill the parent width when the fullWidthprop was set
- Fixes a bug where click handlers were not passed correctly when the responsive variant was set to 'hideLabels'
 
- Fixes a bug where icon-only SegmentedControl buttons did not fill the parent width when the 
- 
#2204 522f5806Thanks @iansan5653! - ReplaceuseCombinedRefswithuseRefObjectAsForwardedRef
- 
#2221 9ce64937Thanks @josepmartins! - Overlay documentation fixes
v35.5.0
Permalink to documentation
Minor Changes
- #2180 300025d1Thanks @mattcosta7! - Update the primer/primitives dependency
Patch Changes
- 
#2150 63a2de51Thanks @dgreif! - Ensure all files inlib-esmare in fact esm and not CommonJS
- 
#2145 a2950ac4Thanks @mperrotti! - Updates SegmentedControl component's keyboard navigation to align with the recommendations of GitHub's accessibility team.
- 
#2143 d9b161a0Thanks @mperrotti! - Fixes bugs in form components discovered while fixing/improving Storybook and docs.
v35.4.0
Permalink to documentation
Minor Changes
- 
#2108 e5be3db3Thanks @mperrotti! - Adds a draft component to render a basic segmented control.
- 
#2139 f17446e0Thanks @owenniblock! - Changes focus rules of TabNav to match WAI-ARIA rules for tablist
Patch Changes
- 
#2099 40da598eThanks @siddharthkp! - AnchoredOverlay:aria-expandedattribute is removed from anchor when overlay is not open
- 
#2155 003cbcf0Thanks @mperrotti! - Update Checkbox component to useIsomorphicLayoutEffect instead of useLayoutEffect to support SSR
- 
#2154 96ad635bThanks @mperrotti! - Allow "falsely/empty" Autocomplete.Input values
- 
#2153 ce45de30Thanks @willglas! - Add AutocompleteContext to Autocomplete component exports
- 
#2105 c7bbd06fThanks @siddharthkp! - ActionMenu: Replace typeahead behavior with single key mnemonics
- 
#2125 78dc8134Thanks @owenniblock! - Adds roles of tablist and tab to the TabNav component, required rearranging the HTML elements to be semantically correct
- 
#2149 b3a98bacThanks @dgreif! - Converted commonjsrequireoffocus-visibleto an esmimport
- 
#2120 53713b2fThanks @colebemis! - Deprecate SideNav in favor of NavList.Before<SideNav aria-label="Main"> <SideNav.Link href="/" selected> Home </SideNav.Link> <SideNav.Link href="/about">About</SideNav.Link> <SideNav.Link href="/contact">Contact</SideNav.Link> </SideNav> After<NavList aria-label="Main"> <NavList.Item href="/" aria-current="page"> Home </NavList.Item> <NavList.Item href="/about">About</NavList.Item> <NavList.Item href="/contact">Contact</NavList.Item> </NavList> 
- 
#2133 65fcd9f2Thanks @mattcosta7! - Passthrough ActionList.Group props from NavList.Group
- 
#2158 ac92de47Thanks @owenniblock! - Fixes issue when tabs are not links
Documentation
v35.3.0
Minor Changes
- 
#2112 74e1d138Thanks @colebemis! - NavList is ready to use. You can now import it from the main bundle:import {NavList} from '@primer/react' 
Patch Changes
- 
#2083 ea69ccd6Thanks @ty-v1! - Export new Dialog component from the@primer/react/draftsbundle:- import {Dialog} from '@primer/react/lib-esm/Dialog/Dialog' + import {Dialog} from '@primer/react/drafts' 
- 
#2117 6e3532cfThanks @dgreif! - Allow minor version updates for production dependencies
- 
#2095 db5e629cThanks @hectahertz! - Communicate the SelectPanel multi-select capability to assistive technologies.
Documentation
v35.2.2
Patch Changes
- 
#2058 ab30f14aThanks @colebemis! - Add draft ofNavListcomponent
- 
#2038 1c2eeb9cThanks @mperrotti! - Fixes accessibility bugs in the Select component.
- 
#2076 05301033Thanks @colebemis! - DraftNavList.Itemnow accepts anasprop, allowing it to be rendered as a Next.js or React Router link
- 
#2082 3252b74cThanks @mperrotti! - Fixes broken links in the documentation
- 
#2075 56dbbd32Thanks @colebemis! - Fix overflow issues inPageLayout.ContentBefore After   
- 
#2087 b319b29dThanks @mperrotti! - Prevents theonRemoveprop from being passed through to the HTML element from Token, AvatarToken, and IssueToken.
- 
#2077 30f93ffbThanks @colebemis! - Adds support for thesxprop on the draft implementation ofNavListand all its subcomponents (e.g.,NavList.Item)
- 
#2050 0f9edcacThanks @mperrotti! - Finishes updating components with the global focus styles defined in Primer CSS (this PR)
- 
#2054 a682735fThanks @colebemis! - Fixes layout bug with ButtonGroup by changing thedisplayproperty frominline-blocktoinline-flex
- 
#2064 62d90af8Thanks @colebemis! - Add support for sub-items in draft implementation of NavList
- 
#2057 c8f7e235Thanks @mperrotti! - - addscolor-schemestyle to inputs so they get the correct user-agent dark/light styles- crops ToggleSwitch knob's shadow inside the toggle switch boundaries
- changes FormControl styles to prevent <select>,<textarea>,<input>from filling the parent's width when theblockprop has not been passed to the input component
 
- 
#2048 4e15985bThanks @siddharthkp! - ThemeProvider: Bug fix, incolorMode=auto, the theme now syncs with system changes.
v35.2.1
Patch Changes
- 
#2013 5f6c5e22Thanks @mperrotti! - 1. Fix a spacing issue with the loading spinner in aTextInputWithTokens
 2. Bolds form validation text to be visually balanced with the icon
- 
#2053 231c70b9Thanks @langermank! - Namespace UnderlineNav
- 
#2033 0d7a871aThanks @mperrotti! - - Text input inner action's hover bg should not touch the text input edges- Increases touch target area of the text input inner action button
- Deprecated childrenandvariantprops on theTextInputInnerActioncomponent, but they're still supported for now.
 
v35.2.0
Minor Changes
- 
#1947 edc85c96Thanks @mperrotti! - Adds the option to render a trailing action inside of the TextInput component
- 
#1933 ae7650f1Thanks @mperrotti! - Adds a toggle switch component
Patch Changes
- 
#1973 adbcd3bfThanks @colebemis! - ThePageLayoutcomponent now renders HTML5 landmark elements (header,aside,footer) to improve the navigation experience for people using assistive technologies (like screen readers)
- 
#1998 cd8a5bb3Thanks @mperrotti! - Updates the API for token components to align with our size-naming ADR, avatar guidelines, and icon guidelines
- 
#2002 3ebc1bb0Thanks @dgreif! - Update@primer/behaviorsfor better ESM compatibility
v35.1.0
Minor Changes
- 
#1942 3f50ef54Thanks @mperrotti! - Adds button element selector to FilteredSearch button styles
- 
#1920 40ed423eThanks @mperrotti! - Adds a loadings state to our text input components
- 
#1961 767d4166Thanks @simurai! - Bump primer/primitives to7.5.1
Patch Changes
- 
#1970 3b236044Thanks @siddharthkp! - ActionMenu: Fix styles for windows high contrast mode
- 
#1981 e9bb5956Thanks @mperrotti! - Ensures select option text has acceptable contrast in Firefox when in dark mode
- 
#1945 ef3b58a1Thanks @pksjce! - Icon button fixes: Removes iconLabel and adds aria-label to the type
- 
#1959 2025036eThanks @colebemis! - FixTextInputtypes
- 
#1968 1b01485aThanks @mperrotti! - Instead of rendering unexpected FormControl children before the rest of the content, we render them in the same spot we'd normally render a Primer input component
- 
#1967 c83a06f0Thanks @pksjce! - Add overlay props to Autocomplete.Overlay
- 
#1955 77e123f4Thanks @pksjce! - Add disabled color and backgroundColor to Button.Counter
v35.0.1
Patch Changes
- 
#1958 be8f9014Thanks @siddharthkp! - ActionList: Add focus styles for Windows high contrast mode
 ActionList: Fix incorrect role for ActionList.Group outside ActionMenu
- 
#1949 e430bd8bThanks @colebemis! -FormControlnow accepts arefprop
- 
#1960 26c7784dThanks @colebemis! - Checkbox:valueprop is now optional
- 
#1935 40c93d8bThanks @pksjce! - Add monospace prop to textinput
v35.0.0
Major Changes
- 
#1910 e1e8d478Thanks @colebemis! -ActionList2exported types are now prefixed withActionList:ListProps → ActionListProps GroupProps → ActionListGroupProps ItemProps → ActionListItemProps DescriptionProps → ActionListDescriptionProps LeadingVisualProps → ActionListLeadingVisualProps, TrailingVisualProps → ActionListTrailingVisualPropsActionMenu2exported types are now prefixed withActionMenu:MenuButtonProps → ActionMenuButtonProps MenuAnchorProps → ActionMenuAnchorProps
- 
#1910 e1e8d478Thanks @colebemis! -ActionListActionList has been rewritten with a composable API, design updates and accessibility fixes. See full list of props and examples: https://primer.style/react/ActionList Before (v34) After (v35) <ActionList items={[ {text: 'New file'}, {text: 'Copy link'}, {text: 'Edit file'}, ActionList.Divider, {text: 'Delete file', variant: 'danger'} ]} /> <ActionList> <ActionList.Item>New file</ActionList.Item> <ActionList.Item>Copy link</ActionList.Item> <ActionList.Item>Edit file</ActionList.Item> <ActionList.Divider /> <ActionList.Item variant="danger">Delete file</ActionList.Item> </ActionList> <ActionList showItemDividers items={[ { key: '0', leadingVisual: LinkIcon, text: 'github/primer' }, { key: '1', leadingVisual: () => <Avatar src="https://github.com/mona.png" />, text: 'mona', description: 'Monalisa Octocat', descriptionVariant: 'block' }, { key: '2', leadingVisual: GearIcon, text: 'View Settings', trailingVisual: ArrowRightIcon } ]} /> <ActionList showDividers> <ActionList.Item> <ActionList.LeadingVisual> <LinkIcon /> </ActionList.LeadingVisual> github/primer </ActionList.Item> <ActionList.Item> <ActionList.LeadingVisual> <Avatar src="https://github.com/mona.png" /> </ActionList.LeadingVisual> mona <ActionList.Description variant="block">Monalisa Octocat</ActionList.Description> </ActionList.Item> <ActionList.Item> <ActionList.LeadingVisual> <GearIcon /> </ActionList.LeadingVisual> View settings <ActionList.TrailingVisual> <ArrowRightIcon /> </ActionList.TrailingVisual> </ActionList.Item> </ActionList> <ActionList groupMetadata={[ {groupId: '0', header: {title: 'Live query'}}, {groupId: '1', header: {title: 'Layout'}} ]} items={[ {key: '0', text: 'repo:github/github', groupId: '0'}, {key: '1', text: 'Table', groupId: '1'}, {key: '2', text: 'Board', groupId: '1'}, {key: '3', text: 'View settings'} ]} /> <ActionList> <ActionList.Group title="Live query"> <ActionList.Item>repo:github/github</ActionList.Item> </ActionList.Group> <ActionList.Divider /> <ActionList.Group title="Layout"> <ActionList.Item>Table</ActionList.Item> <ActionList.Item>Board Description</ActionList.Item> </ActionList.Group> <ActionList.Divider /> <ActionList.Item>View settings</ActionList.Item> </ActionList> To continue to use the deprecated API for now, change the import path to @primer/react/deprecated:import {ActionList} from '@primer/react/deprecated' You can use the one-time codemod to change your import statements automatically. 
- 
#1910 e1e8d478Thanks @colebemis! -ActionMenuActionMenu 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: - Instead of using itemsprop, useActionListinsideActionMenu
- Instead of using anchorContentonActionMenu, useActionMenu.Buttonwithchildren
- Instead of using onActionprop onActionMenu, useonSelectprop onActionList.Item
- Instead of using groupMetadataonActionMenu, useActionList.Group
- Instead of overlayPropsonActionMenu, useActionMenu.Overlay
 Before (v34) After (v35) <ActionMenu anchorContent="Menu" onAction={fn} items={[ {text: 'New file'}, {text: 'Copy link'}, {text: 'Edit file'}, ActionMenu.Divider, {text: 'Delete file', variant: 'danger'} ]} overlayProps={{width: 'small'}} /> <ActionMenu> <ActionMenu.Button>Menu</ActionMenu.Button> <ActionMenu.Overlay width="small"> <ActionList> <ActionList.Item onSelect={fn}>New file</ActionList.Item> <ActionList.Item>Copy link</ActionList.Item> <ActionList.Item>Edit file</ActionList.Item> <ActionList.Divider /> <ActionList.Item variant="danger">Delete file</ActionList.Item> </ActionList> </ActionMenu.Overlay> </ActionMenu> To continue to use the deprecated API for now, change the import path to @primer/react/deprecated:import {ActionMenu} from '@primer/react/deprecated' You can use the one-time codemod to change your import statements automatically. 
- Instead of using 
- 
#1910 e1e8d478Thanks @colebemis! -DropdownMenuDropdownMenu has been deprecated in favor of ActionMenu with ActionList See example with selection: https://primer.style/react/ActionMenu#with-selection Migration guide: - Instead of using itemsprop, useActionListinsideActionMenu
- Use selectionVariant="single"onActionListto set the right semantics for selection
- Instead of using selectedItemprop, useselectedprop onActionList.Item
- Instead of using renderAnchorandplaceholderprops onDropdownMenu, useActionMenu.ButtonorActionMenu.Anchor
- Instead of using onChangeprop onDropdownMenu, useonSelectprop onActionList.Item
- Instead of using groupMetadataonDropdownMenu, useActionList.Group
- Instead of overlayPropsonDropdownMenu, useActionMenu.Overlay
 Before (v34) After (v35) const fieldTypes = [ {key: 0, text: 'Text'}, {key: 1, text: 'Number'}, {key: 3, text: 'Date'}, {key: 4, text: 'Single select'}, {key: 5, text: 'Iteration'} ] const Example = () => { const [selectedType, setSelectedType] = React.useState() return ( <DropdownMenu renderAnchor={({children, ...anchorProps}) => ( <ButtonInvisible {...anchorProps}> {children} <GearIcon /> </ButtonInvisible> )} placeholder="Field type" items={fieldTypes} selectedItem={selectedType} onChange={setSelectedType} overlayProps={{width: 'medium'}} /> ) } const fieldTypes = [ {id: 0, text: 'Text'}, {id: 1, text: 'Number'}, {id: 3, text: 'Date'}, {id: 4, text: 'Single select'}, {id: 5, text: 'Iteration'} ] const Example = () => { const [selectedType, setSelectedType] = React.useState() render( <ActionMenu> <ActionMenu.Button aria-label="Select field type">{selectedType.name || 'Field type'}</ActionMenu.Button> <ActionMenu.Overlay width="medium"> <ActionList selectionVariant="single"> {fieldTypes.map(type => ( <ActionList.Item key={type.id} selected={type.id === selectedType.id} onSelect={() => setSelectedType(type)} > {type.name} </ActionList.Item> ))} </ActionList> </ActionMenu.Overlay> </ActionMenu> ) } To continue to use the deprecated API for now, change the import path to @primer/react/deprecated:import {DropdownMenu} from '@primer/react/deprecated' You can use the one-time codemod ... 
- Instead of using