- #2058
ab30f14a
Thanks @colebemis! - Add draft ofNavList
component
- #2038
1c2eeb9c
Thanks @mperrotti! - Fixes accessibility bugs in the Select component.
- #2076
05301033
Thanks @colebemis! - DraftNavList.Item
now accepts anas
prop, allowing it to be rendered as a Next.js or React Router link
- #2082
3252b74c
Thanks @mperrotti! - Fixes broken links in the documentation
-
#2075
56dbbd32
Thanks @colebemis! - Fix overflow issues inPageLayout.Content
Before After
- #2087
b319b29d
Thanks @mperrotti! - Prevents theonRemove
prop from being passed through to the HTML element from Token, AvatarToken, and IssueToken.
- #2077
30f93ffb
Thanks @colebemis! - Adds support for thesx
prop on the draft implementation ofNavList
and all its subcomponents (e.g.,NavList.Item
)
- #2050
0f9edcac
Thanks @mperrotti! - Finishes updating components with the global focus styles defined in Primer CSS (this PR)
- #2054
a682735f
Thanks @colebemis! - Fixes layout bug with ButtonGroup by changing thedisplay
property frominline-block
toinline-flex
- #2064
62d90af8
Thanks @colebemis! - Add support for sub-items in draft implementation of NavList
- #2057
c8f7e235
Thanks @mperrotti! - - addscolor-scheme
style 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 theblock
prop has not been passed to the input component
- #2048
4e15985b
Thanks @siddharthkp! - ThemeProvider: Bug fix, incolorMode=auto
, the theme now syncs with system changes.
- #2013
5f6c5e22
Thanks @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
231c70b9
Thanks @langermank! - Namespace UnderlineNav
- #2033
0d7a871a
Thanks @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
children
andvariant
props on theTextInputInnerAction
component, but they're still supported for now.
- #1947
edc85c96
Thanks @mperrotti! - Adds the option to render a trailing action inside of the TextInput component
- #1933
ae7650f1
Thanks @mperrotti! - Adds a toggle switch component
- #1973
adbcd3bf
Thanks @colebemis! - ThePageLayout
component now renders HTML5 landmark elements (header
,aside
,footer
) to improve the navigation experience for people using assistive technologies (like screen readers)
- #1998
cd8a5bb3
Thanks @mperrotti! - Updates the API for token components to align with our size-naming ADR, avatar guidelines, and icon guidelines
- #1942
3f50ef54
Thanks @mperrotti! - Adds button element selector to FilteredSearch button styles
- #1920
40ed423e
Thanks @mperrotti! - Adds a loadings state to our text input components
- #1970
3b236044
Thanks @siddharthkp! - ActionMenu: Fix styles for windows high contrast mode
- #1981
e9bb5956
Thanks @mperrotti! - Ensures select option text has acceptable contrast in Firefox when in dark mode
- #1945
ef3b58a1
Thanks @pksjce! - Icon button fixes: Removes iconLabel and adds aria-label to the type
- #1959
2025036e
Thanks @colebemis! - FixTextInput
types
- #1968
1b01485a
Thanks @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
- #1958
be8f9014
Thanks @siddharthkp! - ActionList: Add focus styles for Windows high contrast mode ActionList: Fix incorrect role for ActionList.Group outside ActionMenu
- #1949
e430bd8b
Thanks @colebemis! -FormControl
now accepts aref
prop
- #1960
26c7784d
Thanks @colebemis! - Checkbox:value
prop is now optional
-
#1893
17ef5ef8
Thanks @siddharthkp! -⚠️ 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
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.
-
#1883
310e6553
Thanks @siddharthkp! -ActionList2
exported types are now prefixed withActionList
:ListProps → ActionListProps GroupProps → ActionListGroupProps ItemProps → ActionListItemProps DescriptionProps → ActionListDescriptionProps LeadingVisualProps → ActionListLeadingVisualProps, TrailingVisualProps → ActionListTrailingVisualProps
ActionMenu2
exported types are now prefixed withActionMenu
:MenuButtonProps → ActionMenuButtonProps MenuAnchorProps → ActionMenuAnchorProps
-
#1897
d4023572
Thanks @siddharthkp! -⚠️ 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:
- Instead of using
items
prop, useActionList
insideActionMenu
- Instead of using
anchorContent
onActionMenu
, useActionMenu.Button
withchildren
- Instead of using
onAction
prop onActionMenu
, useonSelect
prop onActionList.Item
- Instead of using
groupMetadata
onActionMenu
, useActionList.Group
- Instead of
overlayProps
onActionMenu
, 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
-
#1898
d6d1ca4c
Thanks @siddharthkp! -⚠️ DropdownMenu has been deprecated in favor of ActionMenu with ActionListSee example with selection: https://primer.style/react/ActionMenu#with-selection
Migration guide:
- Instead of using
items
prop, useActionList
insideActionMenu
- Use
selectionVariant="single"
onActionList
to set the right semantics for selection - Instead of using
selectedItem
prop, useselected
prop onActionList.Item
- Instead of using
renderAnchor
andplaceholder
props onDropdownMenu
, useActionMenu.Button
orActionMenu.Anchor
- Instead of using
onChange
prop onDropdownMenu
, useonSelect
prop onActionList.Item
- Instead of using
groupMetadata
onDropdownMenu
, useActionList.Group
- Instead of
overlayProps
onDropdownMenu
, 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 to change your import statements automatically.
⚠️ DropdownMenu2 has been removed in favor of ActionMenu with ActionList - Instead of using
-
#1889
e9b81fae
Thanks @mperrotti! -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:- No more
medium
size - onlysmall
andlarge
- Labels are outlined by default, so the
outline
prop has been removed - Custom text and background colors are discouraged, but still possible via the
sx
prop
If you were using the
Label
component to render issue/PR labels, use the IssueLabelToken component instead.Before (v34) After (v35) import {Label} from '@primer/react' function Example() { return ( <> <Label outline>default</Label> <Label variant="small" outline sx={{borderColor: 'danger.emphasis', color: 'danger.fg'}}> danger </Label> </> ) }
import {Label} from '@primer/react' function Example() { return ( <> <Label>default</Label> <Label size="small" variant="danger"> danger </Label> </> ) }
To continue to use the deprecated API for now, change the import path to
@primer/react/deprecated
:import {Label} from '@primer/react/deprecated'
You can use the one-time codemod to change your import statements automatically.
- No more
-
#1908
61404aed
Thanks @pksjce! -Before
v35
,Button
was a set of seven independent components. Inv35
, we've simplified theButton
API.We now support a variant property which takes values
primary
,invisible
,outline
anddanger
Before (v34) After (v35) import {ButtonPrimary, ButtonInvisible, ButtonOutline, ButtonDanger} from '@primer/react' function Example() { return ( <> <ButtonPrimary>Primary Button</ButtonPrimary> <ButtonInvisible>Invisible Button</ButtonInvisible> <ButtonOutline>Outline Button</ButtonOutline> <ButtonDanger>Danger Button</ButtonDanger> </> ) }
import {Button} from '@primer/react' function Example() { return ( <> <Button variant="primary">Primary Button</Button> <Button variant="invisible">Invisible Button</Button> <Button variant="outline">Outline Button</Button> <Button variant="danger">Danger Button</Button> </> ) }
Previously including icons inside buttons required a lot of custom styling. In the new
Button
component, we now support first-classleadingIcon
andtrailingIcon
props:Before (v34) After (v35) <Button> <SearchIcon /> Search </Button>
<Button leadingIcon={SearchIcon}>Search</Button>
Icon-only buttons are common in many applications. We now have a component designed for this use-case:
Before (v34) After (v35) <Button> <XIcon /> </Button>
<IconButton aria-label="Close button" icon={XIcon} />
Previously, we used a
variant
prop to set the size of buttons. We now have a prop calledsize
which is more semantically correct.Before (v34) After (v35) <Button variant="small">Small button</Button>
<Button size="small">Small button</Button>
-
#1900
d61b28ad
Thanks @mperrotti! -⚠️ TheCheckboxGroup
andRadioGroup
components are replacing theChoiceFieldset
component.CheckboxGroup
andRadioGroup
have 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.Before (v34) After (v35) import {ChoiceFieldset} from '@primer/react' function Example() { return ( <> {/* Multi-select */} <ChoiceFieldset> <ChoiceFieldset.Legend>Preferred Primer component interface</ChoiceFieldset.Legend> <ChoiceFieldset.List selectionVariant="multiple"> <ChoiceFieldset.Item value="figma">Figma library</ChoiceFieldset.Item> <ChoiceFieldset.Item value="css">Primer CSS</ChoiceFieldset.Item> <ChoiceFieldset.Item value="react">Primer React components</ChoiceFieldset.Item> <ChoiceFieldset.Item value="viewcomponents">Primer ViewComponents</ChoiceFieldset.Item> </ChoiceFieldset.List> </ChoiceFieldset> {/* Single select */} <ChoiceFieldset> <ChoiceFieldset.Legend>Preferred Primer component interface</ChoiceFieldset.Legend> <ChoiceFieldset.List> <ChoiceFieldset.Item value="figma">Figma library</ChoiceFieldset.Item> <ChoiceFieldset.Item value="css">Primer CSS</ChoiceFieldset.Item> <ChoiceFieldset.Item value="react">Primer React components</ChoiceFieldset.Item> <ChoiceFieldset.Item value="viewcomponents">Primer ViewComponents</ChoiceFieldset.Item> </ChoiceFieldset.List> </ChoiceFieldset> </> ) }
import {CheckboxGroup, RadioGroup, FormControl, Checkbox, Radio} from '@primer/react' function Example() { return ( <> {/* Multi-select */} <CheckboxGroup> <CheckboxGroup.Label>Preferred Primer component interface</CheckboxGroup.Label> <FormControl> <Checkbox value="figma" /> <FormControl.Label>Figma</FormControl.Label> </FormControl> <FormControl> <Checkbox value="css" /> <FormControl.Label>CSS</FormControl.Label> </FormControl> <FormControl> <Checkbox value="react" /> <FormControl.Label>Primer React components</FormControl.Label> </FormControl> <FormControl> <Checkbox value="viewcomponents" /> <FormControl.Label>Primer ViewComponents</FormControl.Label> </FormControl> </CheckboxGroup> {/* Single select */} <RadioGroup name="preferred-primer"> <RadioGroup.Label>Preferred Primer component interface</RadioGroup.Label> <FormControl> <Radio value="figma" /> <FormControl.Label>Figma</FormControl.Label> </FormControl> <FormControl> <Radio value="css" /> <FormControl.Label>CSS</FormControl.Label> </FormControl> <FormControl> <Radio value="react" /> <FormControl.Label>Primer React components</FormControl.Label> </FormControl> <FormControl> <Radio value="viewcomponents" /> <FormControl.Label>Primer ViewComponents</FormControl.Label> </FormControl> </RadioGroup> </> ) }
To continue to use the deprecated API for now, change the import path to
@primer/react/deprecated
:import {ChoiceFieldset} from '@primer/react/deprecated'
You can use the one-time codemod to change your import statements automatically.
-
#1882
df757521
Thanks @colebemis! -PageLayout
is being graduated from thedrafts
bundle to themain
bundle.To upgrade, rewrite your imports accordingly:
- import {PageLayout} from '@primer/react/drafts' + import {PageLayout} from '@primer/react'
-
#1888
f94dcd33
Thanks @mperrotti! -⚠️ TheFormControl
component is replacing theFormGroup
,InputField
, andChoiceInputField
components. 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.Before (v34) After (v35) import {FormControl, Checkbox, TextInput} from '@primer/react' function Example() { return ( <> <FormGroup> <FormGroup.Label htmlFor="example-text">Example text</FormGroup.Label> <TextInput id="example-text" /> </FormGroup> {/* OR */} <InputField> <InputField.Label>Example text</InputField.Label> <TextInput /> </InputField> {/* OR */} <ChoiceInputField> <ChoiceInputField.Label>Example text</ChoiceInputField.Label> <Checkbox /> </ChoiceInputField> </> ) }
import {FormGroup, TextInput} from '@primer/react' function Example() { return ( <> <FormControl> <FormControl.Label>Example text</FormControl.Label> <TextInput /> </FormControl> {/* OR */} <FormControl> <FormControl.Label>Example text</FormControl.Label> <Checkbox /> </FormControl> </> ) }
import {InputField, TextInput} from '@primer/react' function Example() { return ( <InputField> <InputField.Label>Example text</InputField.Label> <TextInput /> </InputField> ) }
import {FormControl, TextInput} from '@primer/react' function Example() { return ( <FormControl> <FormControl.Label>Example text</FormControl.Label> <TextInput /> </FormControl> ) }
To continue to use the deprecated API for now, change the import path to
@primer/react/deprecated
:import {FormGroup, ChoiceInputField, InputField} from '@primer/react/deprecated'
You can use the one-time codemod to change your import statements automatically.
-
#1881
8cd12439
Thanks @pksjce! -⚠️ SelectMenu
has been deprecated. Please useActionMenu
instead.Before After <SelectMenu> <Button as="summary">Projects</Button> <SelectMenu.Modal> <SelectMenu.Header>Projects</SelectMenu.Header> <SelectMenu.List> <SelectMenu.Item href="#">Primer React bugs</SelectMenu.Item> <SelectMenu.Item href="#">Primer React roadmap</SelectMenu.Item> <SelectMenu.Item href="#">Project 3</SelectMenu.Item> <SelectMenu.Item href="#">Project 4</SelectMenu.Item> </SelectMenu.List> </SelectMenu.Modal> </SelectMenu>
<ActionMenu> <ActionMenu.Button>Projects</ActionMenu.Button> <ActionMenu.Overlay> <ActionList showDividers> <ActionList.Group title="Projects"> <ActionList.Item>Primer React bugs</ActionList.Item> <ActionList.Item>Primer React roadmap</ActionList.Item> <ActionList.Item>Project three</ActionList.Item> <ActionList.Item>Project four</ActionList.Item> </ActionList.Group> </ActionList> </ActionMenu.Overlay> </ActionMenu>
See https://primer.style/react/ActionMenu for more migration examples.
⚠️ Dropdown
has been deprecated. Please useActionMenu
instead.Before After const fieldTypes = [ {leadingVisual: TypographyIcon, text: 'Text'}, {leadingVisual: NumberIcon, text: 'Number'} ] const Example = () => { const [selectedItem, setSelectedItem] = React.useState() return ( <DropdownMenu renderAnchor={({children, ...anchorProps}) => <ButtonInvisible {...anchorProps}>{children}</ButtonInvisible>} placeholder="Select a field type" items={fieldTypes} selectedItem={selectedItem} onChange={() => setSelectedIndex(index)} /> ) }
const fieldTypes = [ {icon: <TypographyIcon />, name: 'Text'}, {icon: <NumberIcon />, name: 'Number'} ] const Example = () => { const [selectedItem, setSelectedItem] = React.useState() return ( <ActionMenu> <ActionMenu.Button>{selectedItem ? selectedItem.name : 'Select a field type'}</ActionMenu.Button> <ActionMenu.Overlay> <ActionList selectionVariant="single"> {fieldTypes.map(field => ( <ActionList.Item onSelect={() => setSelectedItem(field)} key={field.name}> <ActionList.LeadingVisual>{field.icon}</ActionList.LeadingVisual> {field.name} </ActionList.Item> ))} </ActionList> </ActionMenu.Overlay> </ActionMenu> ) }
See https://primer.style/react/ActionMenu for more migration examples.
⚠️ Flex
has been deprecated. Please useBox
instead.Before After <Flex flexWrap="nowrap"> <Box p={3} color="fg.onEmphasis" bg="accent.emphasis"> Item 1 </Box> </Flex>
<Box display="flex" flexWrap="nowrap"> <Box p={3} color="fg.onEmphasis" bg="accent.emphasis"> Item 1 </Box> </Box>
⚠️ Grid
has been deprecated. Please useBox
instead.Before After <Grid gridTemplateColumns="repeat(2, auto)" gridGap={3}> <Box p={3} color="fg.onEmphasis" bg="accent.emphasis"> 1 </Box> <Box p={3} color="fg.onEmphasis" bg="attention.emphasis"> 2 </Box> </Grid>
<Box display="grid" gridTemplateColumns="repeat(2, auto)" gridGap={3}> <Box p={3} color="fg.onEmphasis" bg="accent.emphasis"> 1 </Box> <Box p={3} color="fg.onEmphasis" bg="attention.emphasis"> 2 </Box> </Box>
⚠️ BorderBox
has been deprecated. Please useBox
instead.Before After <BorderBox>Item 1</BorderBox>
<Box borderWidth="1px" borderStyle="solid" borderColor="border.default" borderRadius={2}> Item 1 </Box>
⚠️ Position
has been deprecated. Please useBox
instead.Before After <> <Position position="absolute">...</Position> <Absolute>...</Absolute> <Relative>...</Relative> <Fixed>...</Fixed> <Sticky>...</Sticky> </>
<> <Box position="absolute">...</Box> <Box position="absolute">...</Box> <Box position="relative">...</Box> <Box position="fixed">...</Box> <Box position="sticky">...</Box> </>
- #1921
561aad86
Thanks @siddharthkp! - Add align prop on ActionMenu.Overlay to pass through to AnchoredOverlay
- #1922
b1d7b8c9
Thanks @siddharthkp! - ActionMenu.Button: Fix spacing between text and caret
- #1915
a98091c1
Thanks @siddharthkp! - - Update styles for default variant of Button's active state- Use active state for Button when it is used to open an Overlay
-
#1934
33da6a0e
Thanks @rezrah! - Surfaced the following components and hooks from the root index:- Portal
- AnchoredOverlay
- useFocusTrap
- useFocusZone (and types)
- sx (and types)
- ConfirmationDialogProps
These exports can now be imported from the root index, rather than from their nested subfolders.
E.g.
- import { ConfirmationDialogProps } from '@primer/react/lib-esm/Dialog/ConfirmationDialog'; + import { ConfirmationDialogProps } from '@primer/react';
- #1936
ceaaf171
Thanks @siddharthkp! - ThemeProvider: FixsetColorMode
. Broken in34.6.0
- #1913
92a02377
Thanks @siddharthkp! - Fixes the theming implementation with server side rendering to use a CSRF safe approach
- #1862
eebb3f27
Thanks @mperrotti! - Adds CheckboxGroup and RadioGroup components to replace the ChoiceFieldset component
- #1886
ecbf923e
Thanks @mperrotti! - Makes it possible to render leading and trailing visuals in TextInputWithTokens just like we do in TextInput
- #1914
b651d70d
Thanks @siddharthkp! - ActionMenu: Fix typeahead with leading visuals
- #1834
2abd7b7a
Thanks @siddharthkp! - ActionMenu2 + DropdownMenu2: Implement typeahead search. See detailed spec.
- #1877
50fa9880
Thanks @siddharthkp! - Upgrade @primer/behaviors to 1.1.0
- #1876
6cc9260a
Thanks @siddharthkp! - Better aria roles for ActionList group
- #1848
96a151ac
Thanks @siddharthkp! - Merges drafts/DropdownMenu2 into drafts/ActionMenu2
- #1866
01efa73f
Thanks @siddharthkp! - Fix the behavior of Escape key in nested overlays #1854, now only the top most overlay will close instead of all of them.
- #1855
c3b4ad70
Thanks @jclem! - Fix an issue where transitive dependency interface augmentations appeared in our build output
- #1826
004c4623
Thanks @PeterYangIO! - Remove unnecessary "required field" label title in favor for nativerequired
input attribute
- #1868
f3f42553
Thanks @siddharthkp! - Fixes a bug for theming with server side rendering where the output of the server and client mismatch #1773
- #1831
96473f39
Thanks @mperrotti! - Makes validation styling available for Select and TextInputWithTokens
- #1836
7e8ae653
Thanks @mperrotti! - Introduces FormControl component. The FormControl component combines the functionality of InputField and ChoiceInputField, and will replace FormGroup, InputField, and ChoiceInputField.
- #1846
65c405b6
Thanks @colebemis! - PageLayout: Prevent content region from wrapping on wide viewports
- #1856
3f405221
Thanks @siddharthkp! - Revert "Overlay: Attach escape handler to overlay container"
- #1850
fad43d67
Thanks @mperrotti! - FormControl:- Add
sx
prop - Rename
appearance
prop tovariant
- Add
- #1824
4eab65e5
Thanks @siddharthkp! - Overlay: Attach escape handler to overlay container instead of document to fix stopPropagation
- #1840
1c4786c7
Thanks @jclem! - Set Node.js and npm versions to ">=12" and ">=7", respectively, in package.json manifests, and update package-lock.json files accordingly.
- #1828
6a695bdc
Thanks @siddharthkp! - ActionMenu2 + DropdownMenu2: A keyboard user will be able to wrap through options
-
#1810
35ad7084
Thanks @siddharthkp! - ActionMenu2 + DropdownMenu2: Focus the correct element when Menu is opened with keyboard. See detailed spec.- ArrowDown | Space | Enter: first element
- ArrowUp: last element
- #1842
11011f55
Thanks @jclem! - AllowKeyPaths
type to accept any type in order to remove need for// @ts-ignore
internally.
- #1820
50c7bfaa
Thanks @colebemis! - Add draftPageLayout
component
- #1797
8b376b9d
Thanks @mperrotti! - Introduces a draft for component to replace the existing Label component
- #1759
493c6ea1
Thanks @siddharthkp! - AnchoredOverlay: Add support for passing an id to the anchor. Remove unnecessary aria-labelledby on anchor. ActionMenu v2: Add aria-labelledby for ActionList
- #1779
2630800d
Thanks @siddharthkp! - ActionMenu v2: ActionMenu.Button now uses Button v2
- #1735
8ff114b1
Thanks @siddharthkp! - Add composableDropdownMenu
to@primer/components/drafts
- #1804
aa09ed79
Thanks @rezrah! - Fixes bug in PointerBox component where caret doesn't inherit correct styling. Backwards compatible with previous API.
- #1736
82961d44
Thanks @mperrotti! - Adds a component for a native select input
- #1657
d143c956
Thanks @mperrotti! - Adds ChoiceFieldset component
- #1758
b604403c
Thanks @siddharthkp! - ActionMenu v2: Add aria-expanded to the ActionMenu.Button
- #1770
39a3bc29
Thanks @PeterYangIO! - Adds aria-hidden="true" to InputLabel required asterisk
- #1794
a8c427da
Thanks @rezrah! - replaceLocation | Pathname
union type forto
prop with more appropriateTo
- #1757
6e44d786
Thanks @siddharthkp! - ActionList v2 Divider: Make divider aria-hidden
- #1791
6a8472b4
Thanks @rezrah! - Fix type errors due to missing pathname (string) in union type for LocationDescriptor
- #1611
11382eeb
Thanks @mperrotti! - Adds TextInputField, CheckboxInputField, and RadioInputField components. Also adds a few internal (private to primer/react) components to support form fields
- #1754
08cdb0bc
Thanks @siddharthkp! - Fix title and subtitle tag for Dialog2 and ConfirmationDialog
- #1700
9d2827a9
Thanks @dgreif! - Use extracted @primer/behaviors for hook behaviors
- #1712
4ce8f07b
Thanks @colebemis! - Remove "engines" field from package.json
- #1734
bba4c245
Thanks @siddharthkp! - Button v2 - Fix font family
-
#1676
1195336e
Thanks @colebemis! - Rename npm package from@primer/components
to@primer/react
To upgrade, run:
npm uninstall @primer/components npm install @primer/react
Then update your imports:
- import {Box} from '@primer/components' + import {Box} from '@primer/react'
- #1675
2380b668
Thanks @siddharthkp! - ActionMenu v2: AddedActionMenu.Overlay
which accepts props to customize the Menu overlay.
- #1702
2c42c382
Thanks @colebemis! - UpdateBranchName
styles to match github.com
- #1643
3938550f
Thanks @jfuchs! - Details no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1643
3938550f
Thanks @jfuchs! - Avatar no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1643
3938550f
Thanks @jfuchs! - BranchName no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1643
3938550f
Thanks @jfuchs! - Heading no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1619
a13efa45
Thanks @siddharthkp! - Add composableActionMenu
to@primer/components/drafts
- #1679
006cc80b
Thanks @mattcosta7! - AddresolvedColorScheme
property to the object returned byuseTheme()
- #1668
98dc6336
Thanks @siddharthkp! - ActionList: Fix multiple selection svg by overriding global shape-rendering for github.com
- #1596
5c6dc644
Thanks @dmarcey! - Fix alignment of items in ActionList (single-select) if some of the items have wrapping text.
- #1538
dda6e5d7
Thanks @shiftkey! - Updatetypescript
package to correct generated type declarations.
- #1649
b1315367
Thanks @jonrohan! - Upgrading primer/[email protected]
- #1652
47550d34
Thanks @colebemis! - Fix preval oftheme-preval.js
- #1639
8ce0eb92
Thanks @jfuchs! - Truncate no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Timeline no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Dropdown no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Pagehead no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - LabelGroup no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Link no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Popover no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - StateLabel no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - CircleBadge no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - SelectMenu no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Header no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - UnderlineNav no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Overlay no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - StyledOcticon no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Dialog no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - TabNav no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - SubNav no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Dialog2 no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Buttons no longer accept styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Label no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Flash no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Tooltip no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Pagination no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - Breadcrumbs no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - FilteredSearch no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - SideNav no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - FilterList no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - CounterLabel no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1639
8ce0eb92
Thanks @jfuchs! - FormGroup no longer accepts styled-system props. Please use thesx
prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information aboutsx
and https://primer.style/react/system-props for context on the removal.
- #1598
3bb895f1
Thanks @siddharthkp! - ActionList: Better semantics for accessible ActionList.Group
- #1601
250e4b00
Thanks @siddharthkp! - ActionList: Use icon instead of input for multiple selection in ActionList
- #1629
47fdbf40
Thanks @siddharthkp! - ActionList: Visual update for disabled Items to make them more obvious
- #1486
34cfca53
Thanks @pksjce! - ActionList: Add focus and hover colors to all themes in Item using functional variables
- #1544
5b55b0ab
Thanks @jfuchs! - The sx prop now has types that will inform autocomplete for color and shadow values that are key paths into the theme.
- #1517
561c0bd3
Thanks @siddharthkp! - Add experimentalActionList
with composable API
- #1599
a2e195b0
Thanks @siddharthkp! - ActionList: Better labels and description for accessible ActionList.Item
- #1603
f4057b89
Thanks @siddharthkp! - ActionList: Improve keyboard accessibility with focus styles cross browser
- #1583
24b1ebbc
Thanks @pksjce! - Add a utility to provide useIsoMorphicEffect function and use that instead of useLayoutEffect everywhere
- #1592
8d3d491f
Thanks @rezrah! - Fixes a styling bug in TextInput components while using itsicon
andblock
props together
- #1549
f565840f
Thanks @michael-lefebvre! - FixauxiliaryText
in ActionList Group header
- #1609
5eb7ade9
Thanks @siddharthkp! - Rename@primer/components/unreleased
to@primer/components/drafts
to avoid confusion when referring to it.
- #1523
56e2f159
Thanks @mperrotti! - Add the ability to truncate tokens in the TextInputWithToken component when the input is not focused
- #1529
da566044
Thanks @mperrotti! - Fixes a bug inTextInputWithTokens
where the next token would not receive focus after the user deleted the first token using the keyboard
- #1526
1378e771
Thanks @mperrotti! - replaces flexbox gap usage with margins
- #1521
28b5980c
Thanks @siddharthkp! - AddtrailingVisual
prop to ActionList/ActionMenu. DeprecatetrailingIcon
andtrailingText
props.
-
#1514
dc789025
Thanks @colebemis! - Remove deprecated color variables by upgrading to @primer/primitives v5Note: Install
eslint-plugin-primer-react
to ensure that you're not using any deprecated or removed color variables.
- #1490
c156b07a
Thanks @mperrotti! - AddsAutocomplete
,AutocompleteMenu
,AutocompleteInput
, andAutocompleteOverlay
components
- #1489
273ef29d
Thanks @mperrotti! - Add alphaTextInputWithTokens
component
- #1488
05ac5aab
Thanks @mperrotti! - Add alphaToken
,AvatarToken
,IssueLabelToken
components
- #1500
8c3531aa
Thanks @jfuchs! - Fixed a bug where SelectPanel would not scroll with height:'auto'; maxHeight:'medium' passed to Overlay (https://github.com/github/primer/issues/333)
- #1497
b9d6a662
Thanks @jfuchs! - Updated ActionList's ItemInput type to accept DOM props for divs when renderItem is not provided
- #1463
bde3a034
Thanks @jfuchs! -ActionList.item
accepts anas
prop, allowing it to be a link, or (in combination with the renderItem prop) a Next.js or React Router link
- #1471
f1cebb7e
Thanks @smockle! - Change the button which receives focus when a 'ConfirmationDialog' opens from the secondary (e.g. 'Cancel') to the primary (e.g. 'OK'). Fixes github/primer#313.
- #1448
1a39fb02
Thanks @SferaDev! - Remove.Breadcrumb
classname from the root element of theBreadcrumbs
component. This change shouldn't break anything unless you have styles, scripts, or tests that reference the.Breadcrumb
classname.
- #1474
c54156bc
Thanks @colebemis! - Addlight_protanopia
anddark_protanopia
color blind color schemes
- #1441
f3f5afb9
Thanks @jfuchs! - Fix type error wherecss
is a required prop of some components by excluding storybook stories from TypeScript compilation for builds
- #1446
b4e5287c
Thanks @colebemis! - Fix filter input spacing in SelectPanel
- #1412
627cd3e9
Thanks @colebemis! - Adddark_high_contrast
color scheme
-
#1412
627cd3e9
Thanks @colebemis! - Add new functional color variables to the theme object.Tip: Install
eslint-plugin-primer-react
to ensure that you're not using any deprecated color variables.
- #1414
f4e1de6d
Thanks @jfuchs! - Removed system props support from<TextInput>
and fixed its type definition.
- #1403
65cab2cc
Thanks @mathiasbosman! - Fix the Timeline.Item layout
- #1398
e4dac575
Thanks @jfuchs! - Default portal containers created by primer are absolutely positioned at 0,0
- #1385
5470b61b
Thanks @jfuchs! - Make top and left position explicit props of Overlay handled separately from other styles
- #1388
83b888f0
Thanks @jfuchs! - Overlay takes a portalContainerName prop. This allows overlays with an anchor inside a scrolling container to track with their anchor, so long as the specified portal is also inside that scrolling container.
- #1372
23be0ed7
Thanks @jfuchs! - Extends DropdownMenu to allow anchorRef, open, and onOpenChange props.
- #1386
2ea30b43
Thanks @colebemis! - Bump @primer/primitives dependency to 4.6.4
- #1387
6b4d52da
Thanks @jfuchs! - Guard against MediaQueryList.addEventListener calls where unavailable and possibly fall back to .addListener
- #1368
36f156a0
Thanks @dgreif! - AllowanchorRef
to be passed intoSelectPanel
if you want to use an external anchor
- #1355
3cc7be77
Thanks @colebemis! - Replace octoface icon with spinner in SelectMenu component
- #1315
85d0202b
Thanks @VanAnderson! -Box
now accepts all styled system props.
-
#1316
4c063317
Thanks @VanAnderson! - The following components have been deprecated in favor of theBox
component:Component Replacement Flex
<Box display="flex">
Grid
<Box display="grid">
Position
<Box>
Absolute
<Box position="absolute">
Fixed
<Box position="fixed">
Relative
<Box position="relative">
Sticky
<Box position="sticky">
BorderBox
<Box borderWidth="1px" borderStyle="solid" borderColor="border.primary" borderRadius={2}>
There is a codemod available to upgrade these components:
-
TypeScript example:
npx jscodeshift -t node_modules/@primer/react/codemods/deprecateUtilityComponents.js --parser=tsx path/to/workspace/src/*.tsx
-
Babel example:
npx jscodeshift -t node_modules/@primer/react/codemods/deprecateUtilityComponents.js --parser=babel path/to/workspace/src/*.tsx
-
-
#1336
489a718b
Thanks @VanAnderson! - System props are deprecated in all components exceptBox
. Move all system props into thesx
prop instead. Example:- <Button mr={2}>...</Button> + <Button sx={{mr: 2}}>...</Button>
There is a codemod available to migrate from system props to the
sx
prop:-
TypeScript example:
npx jscodeshift -t node_modules/@primer/react/codemods/removeSystemProps.js --parser=tsx path/to/workspace/src/*.tsx
-
Babel example:
npx jscodeshift -t node_modules/@primer/react/codemods/removeSystemProps.js --parser=babel path/to/workspace/src/*.tsx
-
- #1332
ec11d7b8
Thanks @mattcosta7! - Side effects are properly declared in package.json
- #1308
a8f3ca6d
Thanks @dgreif! - Focus zones will now update active-descendant onmousemove
over focusable elements. ActionList has been updated to handle direct (key press) vs indirect (mousemove
, DOM change, etc.) changes to active-descendant, and will use a distinct background color for the directly activated items.
- #1309
dc17a49e
Thanks @colebemis! - Include all shadow variables in theme object
- #1251
528e9a41
Thanks @VanAnderson! - CalluseOnOutsideClick
handlers in reverse order that they are registered, and allow propagation to stop if default is prevented or an non-outside click is detected.
- #1312
76a38432
Thanks @smockle! - Ensure clicking anAnchoredOverlay
’s trigger allows it to close without immediately reopening.
- #1293
1148a718
Thanks @smockle! - Restore "fix: Don’t focus first 'Item' of 'DropdownMenu' and 'SelectMenu' on open" by deferring the removal of a temporarytabIndex
until focus moves within the container.
- #1279
bb38754f
Thanks @VanAnderson! - Update overlay shadows
- #1297
5fb3683d
Thanks @VanAnderson! - Bump @primer/primitives to 4.4.0
- #1288
15207119
Thanks @dgreif! - Focus zones with anactiveDescendantControl
will now activate the first descendant as soon as the control element is focused, rather than waiting for an up/down arrow press. Descendants stay active until the control element is blurred. This is a breaking change touseFocusZone
, but this behavior is still considered to be inalpha
.
- #1279
bb38754f
Thanks @VanAnderson! - Update TextInput border color
0ffc381c
#1294 Thanks @VanAnderson! - Revert first item focus fix for ActionList components.
68877076
#1275 Thanks @VanAnderson! - data props can be used in overlayProps.
2793ef48
#1286 Thanks @colebemis! -ThemeProvider
now uses the first defined color scheme if passed an invalid color scheme name
321b9a3d
#1266 Thanks @VanAnderson! - Anchored overlay can take an external anchorRef.
f793ed00
#1280 Thanks @VanAnderson! - Export TexContainer from of ActionList/Item.
8368a83e
#1238 Thanks @dgreif! - New sizes for Overlay and Dialog. Sizes have been changed from abbreviations to full words.xs
->xsmall
,sm
->small
,md
->medium
,lg
->large
,xl
->xlarge
. The sizing forOverlay
has also been updated to provide a wider range of options. The original values for Overlay were based on the needs of Dialog, but Dialog is not reliant on Overlay so they don't need to have similar sizing. This is technically a breaking change, but is being released as a minor because these components are both still inalpha
status.
25d88c49
#1253 Thanks @dgreif! - Correct font size and truncate for description within ActionList Items
9cb715cd
#1258 Thanks @dgreif! - prevent focusTrap from causing ablur
if trap container is not in DOM
aa7d80fc
#1246 Thanks @dgreif! - Fix border radius on buttons and titlefont-weight
in ConfirmationDialog
c1991318
#1158 Thanks @dgreif! - Add background styles for focused action list items, instead of using defaultoutline
0d26d2b0
#1240 Thanks @VanAnderson! - Fix check Spacing on selected items for ActionList components.
e009e321
#1235 Thanks @VanAnderson! - Dialog properly auto-focuses cancel button by default when originating from a FocusZone/FocusTrap.
e1bde42b
#1228 Thanks @VanAnderson! - Action Menu correctly fires onAction callback after close.
961c07eb
#1227 Thanks @stephenotalora! - Change focus state style ofSideNav.Link
c63fa4b5
#1215 Thanks @dgreif! - AddselectionVariant: 'multiple'
forItem
s. These will use a checkbox input instead of a checkmark icon for selected state
d78af591
#1214 Thanks @VanAnderson! - renderMenuItem in ActionMenu checks preventDefault for conditionally calling onClose
4ab3d175
#1222 Thanks @dgreif! - Trap focus inAnchoredOverlay
as soon as it opens, regardless of the event that triggered it to open
ff9ce6f1
#1217 Thanks @VanAnderson! - overlayProps passthrough from ActionMenu and DropdownMenu to AnchoredOverlay.
d20a5996
#1209 Thanks @dgreif! - Allow Overlay height and width to be set through AnchoredOverlay Allow ActionList Items to supply anid
instead ofkey
Performance improvements when ActionList is not given any groups Enable focus zone as soon as AnchoredOverlay opens
d29741ca
#1196 Thanks @dgreif! - Allow customchildren
inActionItem
.text
anddescription
can still be provided as a shortcut, butchildren
is now available if you need more control over the rending of the item, without sacrificing benefits fromItem
by usingrenderItem
.
4c2e1a2b
#1195 Thanks @VanAnderson! - Export useConfirm hook and ConfirmationDialog component from index.
c9b4db79
#1199 Thanks @VanAnderson! - Action Menu can have its open state be controlled externally.
3e759e59
#1211 Thanks @VanAnderson! - Use preventDefault on AnchoredOverlay instead of stopPropagation.
7aeb53fe
#1200 Thanks @dgreif! - Perform ActionMenu actions after overlay has closed. This allows the action to move focus if so desired, without the ActionMenu focus trap preventing focus from moving away.
bba66fdd
#1206 Thanks @VanAnderson! - stopPropagation for mousedown and click in AnchoredOverlay based components
b319ce43
#1197 Thanks @dmarcey! - Typescript declare files will now be published to the lib-esm directory, as well as lib
5f85394d
#1157 Thanks @dgreif! - RemoveduseMouseIntent
in favor of:focus-visible
. With the removal ofuseMouseIntent
, theintent-mouse
class will no longer be added to the<body>
. Since:focus-visible
is a relatively new psuedo-class, a polyfill is included. Any focused elements that meet the criteria for:focus-visible
will also have afocus-visible
class added to them by the polyfill.
-
db478205
#1147 Thanks @colebemis! - Type definitions are now being generated by TypeScript instead of manually maintained. These new type definitions may differ from the previous type definitions and cause breaking changes. If you experience any new TypeScript errors, feel free to create an issue or reach out in Slack (#design-systems).-
The following types are no longer exported:
BaseProps UseDetailsProps AnchoredPositionHookSettings AnchorAlignment AnchorSide PositionSettings PaginationHrefBuilder PaginationPageChangeCallback PositionComponentProps
-
Props are now defined with types instead of interfaces which means in some cases you may not be able to create interfaces that
extend
them. To work around this issue, you may need to convert your interfaces to types:import {BoxProps} from '@primer/react' - interface MyFancyBox extends BoxProps {...} + type MyFancyBox = BoxProps & {...}
-
Some components now expect more specific ref types. For example:
- const ref = React.useRef<HTMLElement>(null) + const ref = React.useRef<HTMLButtonElement>(null) return <Button ref={ref}>...</Button>
-
-
016a273f
#1115 Thanks @VanAnderson! - Removes deprecated presentational theme variables in favor of functional variables for styling components that are consistent across multiple themes.If you don't use any color-related system props (e.g.
color
,bg
,borderColor
), all components should work without changes. If you're using color-related system props, you'll need to update them to use the new functional variables. Reference the tables below to see how old variables map to new functional variables.If you have any questions, feel free to reach out in the #design-systems channel.
v25
v26
color="text.gray"
color="text.secondary"
color="text.grayLight"
color="text.tertiary"
color="text.grayDark"
color="text.primary"
color="text.red"
color="text.danger"
color="text.white"
color="text.inverse"
color="gray.6"
color="text.secondary"
color="gray.5"
color="text.tertiary"
color="gray.9"
color="text.primary"
color="red.6"
color="text.danger"
color="white"
color="text.inverse"
color="blue.5"
color="text.link"
color="gray.4"
color="text.disabled"
color="green.5"
color="text.success"
color="yellow.8"
color="text.warning"
v25
v25
color="gray.9"
color="icon.primary"
color="gray.6"
color="icon.secondary"
color="gray.4"
color="icon.tertiary"
color="blue.5"
color="icon.info"
color="red.5"
color="icon.danger"
color="green.6"
color="icon.success"
color="yellow.8"
color="icon.warning"
v25
v26
borderColor="border.blue"
borderColor="border.info"
borderColor="border.blueLight"
n/a borderColor="border.grayLight"
borderColor="border.primary"
borderColor="border.grayDark"
borderColor="border.tertiary"
borderColor="border.grayDarker"
n/a borderColor="border.green"
borderColor="border.success"
borderColor="border.greenLight"
n/a borderColor="border.purple"
n/a borderColor="border.red"
borderColor="border.danger"
borderColor="border.redLight"
n/a borderColor="border.white"
borderColor="border.inverse"
borderColor="border.whiteFace"
n/a borderColor="border.yellow"
borderColor="border.warning"
borderColor="border.blackFade"
borderColor="fade.fg15"
borderColor="border.whiteFade"
borderCOlor="fade.white15"
borderColor="blue.5"
borderColor="border.info"
borderColor="gray.2"
borderColor="border.primary"
borderColor="gray.3"
borderColor="border.tertiary"
borderColor="green.4"
borderColor="border.success"
borderColor="red.5"
borderColor="border.danger"
borderColor="white"
borderColor="border.inverse"
v25
v26
bg="white"
bg="bg.primary"
bg="bg.grayLight"
bg="bg.secondary"
bg="bg.gray"
bg="bg.tertiary"
bg="bg.grayDark"
bg="bg.canvasInverse"
bg="blue.0"
bg="bg.info"
bg="blue.5"
bg="bg.infoInverse"
bg="red.0"
bg="bg.danger"
bg="red.5"
bg="bg.dangerInverse"
bg="green.1"
bg="bg.success"
bg="green.5"
bg="bg.successInverse"
Note the change in pluralization from 'labels' to 'label'.
v25
v26
color="labels.grayDarkText"
color="label.primary.text
borderColor="labels.gray"
borderColor="label.primary.border
color="labels.grayText"
color="label.secondary.text
borderColor="labels.gray"
borderColor="label.secondary.border
color="labels.blueText"
color="label.info.text
borderColor="labels.blue"
borderColor="label.info.border
color="labels.greenText"
color="label.success.text
borderColor="labels.green"
borderColor="label.success.border
color="labels.yellowText"
color="label.warning.text
borderColor="labels.yellow"
borderColor="label.warning.border
color="labels.redText"
color="label.danger.text
borderColor="labels.red"
borderColor="label.danger.border
color="labels.orangeText"
color="label.primary.text
borderColor="labels.orange"
borderColor="label.primary.text
color="labels.pinkText"
n/a borderColor="labels.pink"
n/a color="labels.purpleText"
n/a borderColor="labels.purple"
n/a v25
v26
scheme="gray"
scheme="primary"
scheme="gray-light"
scheme="secondary"
v25
v26
bg="red.5"
bg="prState.closed.bg"
bg="green.5"
bg="prState.open.bg"
bg="purple.5"
bg="prState.merged.bg"
bg="gray.5"
bg="prState.draft.bg"
color="white"
(context: closed PR icon)color="prState.closed.text"
color="white"
(context: open PR icon)color="prState.open.text"
color="white"
(context: merged PR icon)color="prState.merged.text"
color="white"
(context: merged PR icon)color="prState.draft.text"
-
8799f74a
#1112 Thanks @colebemis! - Primer React now supports color modes! 🎉See the new Theming documentation for more details.
- You'll need to replace the
ThemeProvider
fromstyled-components
with the new Primer ReactThemeProvider
:
- import {ThemeProvider} from 'styled-components' - import {theme} from '@primer/react + import {ThemeProvider} from '@primer/react' function App() { return ( - <ThemeProvider theme={theme}> + <ThemeProvider> <div>your app here...</div> </ThemeProvider> ) }
- The structure of the theme object has changed to support color schemes:
const theme = { - colors, - shadows, + colorSchemes: { + light: { + colors, + shadows, + }, + dark: {...}, + dark_dimmed: {...}, + }, space, fonts, fontSizes, fontWeights, lineHeights, borderWidths, radii, breakpoints, sizes, }
- The
theme.colors
andtheme.shadows
objects are no longer available from thetheme
export. Use theuseTheme
hook instead:
- import {theme} from '@primer/react' + import {useTheme} from '@primer/react' function Example() { + const {theme} = useTheme() const myColor = theme.colors.text.primary ... }
- You'll need to replace the
360e3595
#1111 Thanks @VanAnderson! - Update color variable used in ProgressBar (state.success
→bg.successInverse
)
1b3d87d2
#1127 Thanks @VanAnderson! - Bump @primer/primitives from 0.0.0-20211167520 to 0.0.0-20212178221
b9d9d245
#1068 Thanks @colebemis! - Remove propTypes in favor of TypeScript types
-
beef075e
#1094 Thanks @colebemis! - Components no longer have a defaulttheme
prop. To ensure components still render correctly, you'll need pass the Primer theme to a styled-components<ThemeProvider>
at the root of your application:import {ThemeProvider} from 'styled-components' import {theme} from '@primer/react' function App(props) { return ( <div> <ThemeProvider theme={theme}> <div>your app here</div> </ThemeProvider> </div> ) }
397f3360
#1106 Thanks @VanAnderson! - Use functional color variables in Pagination
fa106ea9
#1090 Thanks @colebemis! - Use functional color variables in BaseStyles
fa106ea9
#1090 Thanks @colebemis! - Use functional color variables in BranchName
e93cf268
#1092 Thanks @bscofield! - Use functional color variables in Caret, CircleBadge, Pagehead, ProgressBar, and Popover
5a042778
#1099 Thanks @VanAnderson! - Use functional color variables in FilterList
a886bbcf
#1098 Thanks @bscofield! - Update SelectMenu and child components to use functional color variables
f2c57794
#1085 Thanks @VanAnderson! - Use functional color variables in SideNav
756191e7
#1100 Thanks @VanAnderson! - Use functional color variables in ButtonOutline
6b2dc95f
#1085 Thanks @VanAnderson! - Use functional color variables in TabNav
51d180ac
#1089 Thanks @colebemis! - Use functional color variables in Timeline
51d180ac
#1089 Thanks @colebemis! - Use functional color variables in TextInput
8f2b4d2e
#1100 Thanks @VanAnderson! - Use functional color variables in ButtonPrimary
51d180ac
#1089 Thanks @colebemis! - Use functional color variables in Link
fa106ea9
#1090 Thanks @colebemis! - Use functional color variables in BorderBox
51d180ac
#1089 Thanks @colebemis! - Use functional color variables in Tooltip
1fb750af
#1097 Thanks @VanAnderson! - Use functional color variables in ButtonTableList
ea21d8eb
#1102 Thanks @VanAnderson! - Use functional color variables in Flash
51d180ac
#1089 Thanks @colebemis! - Use functional color variables in UnderlineNav
d0f38c3d
#1102 Thanks @VanAnderson! - Use functional color variables in Header
5df7723a
#1099 Thanks @VanAnderson! - Use functional color variables in DropdownStyles
170876e6
#1097 Thanks @VanAnderson! - Use functional color variables in Button
c44ee363
#1085 Thanks @VanAnderson! - Use functional color variables in SubNav
198e24ad
#1100 Thanks @VanAnderson! - Use functional color variables in ButtonDanger
39371d98
#1099 Thanks @VanAnderson! - Use functional color variables in CounterLabel
92597504
#1100 Thanks @VanAnderson! - Use functional color variables in ButtonClose
fa106ea9
#1090 Thanks @colebemis! - Use functional color variables in AvatarPair
fa106ea9
#1090 Thanks @colebemis! - Use functional color variables in AvatarStack
565f1980
#1097 Thanks @VanAnderson! - Use functional color variables in Breadcrumb
4e19045e
#1085 Thanks @VanAnderson! - Use functional color variables in StateLabel
31025697
#1099 Thanks @VanAnderson! - Use functional color variables in Dialog
67cc5b23
#1097 Thanks @VanAnderson! - Use functional color variables in ButtonInvisible
a42162c0
#1087 Thanks @emplums! - Fix up styles in TabNav allowing for items positioned on the right end of TabNav
c50b9f93
#1059 Thanks @colebemis! - MigrateDropdown
to TypeScript
681799fd
#1066 Thanks @colebemis! - MigrateuseMouseIntent
to TypeScript
eaeb2389
#1055 Thanks @VanAnderson! - Migrateutils
to TypeScript
106eb85e
#1060 Thanks @VanAnderson! - MigrateDialog
to TypeScript
f11e6ac6
#1048 Thanks @colebemis! - MigrateSelectMenu
to TypeScript
bb635a50
#1058 Thanks @colebemis! - Migrate theme to TypeScript
fabca94e
#1047 Thanks @VanAnderson! - MigratePagination
to TypeScript
c868bc96
#1074 Thanks @VanAnderson! - Add functional color variables from Primer Primitives to theme object
e2c90dba
#1049 Thanks @eintxaurtieta! - Added font-family:inherit to TextInput
8de64e95
#1029 Thanks @VanAnderson! - MigrateTabNav
to TypeScript
16aeca6b
#1032 Thanks @colebemis! - MigrateAvatarStack
to TypeScript
4070310a
#1026 Thanks @VanAnderson! - MigrateDetails
to TypeScript
8f483bd9
#1042 Thanks @colebemis! - MigratePointerBox
to TypeScript
c5d2b657
#1035 Thanks @colebemis! - MigrateCircleBadge
to TypeScript
3fcdf25f
#1040 Thanks @VanAnderson! - MigrateSideNav
to TypeScript
ff02c038
#1033 Thanks @colebemis! - MigrateTooltip
to TypeScript
0d62f260
#1030 Thanks @colebemis! - MigrateCaret
to TypeScript
d1785f4c
#1038 Thanks @VanAnderson! - MigrateSubNav
to TypeScript
058e7919
#1036 Thanks @colebemis! - MigrateCircleOcticon
to TypeScript
9b71bf38
#998 Thanks @colebemis! - MigratePosition
to TypeScript
b2ac3010
#1037 Thanks @colebemis! - MigrateTimeline
to TypeScript
ef25d019
#1031 Thanks @colebemis! - MigrateAvatarPair
to TypeScript
62f45a12
#1028 Thanks @colebemis! - MigrateTextInput
to TypeScript
cc36e6b4
#1034 Thanks @colebemis! - MigratePopover
to TypeScript
11340814
#1020 Thanks @VanAnderson! - MigrateHeader
to TypeScript
3e0110bc
#995 Thanks @colebemis! - MigrateFlash
to TypeScript
b0cea82e
#1003 Thanks @colebemis! - MigrateTruncate
to TypeScript
f9a7e78a
#987 Thanks @colebemis! - MigrateProgressBar
to TypeScript
d848b9e0
#993 Thanks @colebemis! - MigrateStyledOcticon
to TypeScript
73bced4b
#1015 Thanks @colebemis! - MigrateFilterList
to TypeScript
b9671ca2
#1005 Thanks @colebemis! - MigrateCounterLabel
to TypeScript
1fb77ac3
#1012 Thanks @colebemis! - MigrateBreadcrumb
to TypeScript
91002078
#1008 Thanks @colebemis! - MigrateStateLabel
to TypeScript
3a3c81a4
#984 Thanks @bscofield! - MigrateAvatar
to TypeScript
df2920f5
#1014 Thanks @colebemis! - MigrateUnderlineNav
to TypeScript
b947aff2
#1006 Thanks @colebemis! - MigrateFilteredSearch
to TypeScript
2e71f70f
#1011 Thanks @VanAnderson! - MigrateLink
to TypeScript
7128403c
#979 Thanks @colebemis! - MigrateText
to TypeScript
fe16e21c
#982 Thanks @colebemis! - MigrateBaseStyles
to TypeScript
ee806857
#975 Thanks @colebemis! - MigrateHeading
to TypeScript
25315571
#976 Thanks @colebemis! - MigrateLabel
to TypeScript
4076bf4e
#986 Thanks @colebemis! - MigrateFlex
to TypeScript
397a46fe
#976 Thanks @colebemis! - MigrateLabelGroup
to TypeScript
dc0df4b2
#973 Thanks @colebemis! - MigrateBorderBox
to TypeScript
0cac0042
#974 Thanks @colebemis! - MigrateBranchName
to TypeScript
755a1a5c
#977 Thanks @colebemis! - MigratePagehead
to TypeScript
34ff4885
#989 Thanks @colebemis! - MigrateGrid
to TypeScript