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/components' - 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/components + import {ThemeProvider} from '@primer/components' 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/components' + import {useTheme} from '@primer/components' 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/components' funciton 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