Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rude-buckets-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Converted commonjs `require` of `focus-visible` to an esm `import`
1 change: 1 addition & 0 deletions @types/focus-visible/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'focus-visible'
6 changes: 3 additions & 3 deletions src/BaseStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import {COMMON, SystemCommonProps, SystemTypographyProps, TYPOGRAPHY} from './co
import {useTheme} from './ThemeProvider'
import {ComponentProps} from './utils/types'

// load polyfill for :focus-visible
import 'focus-visible'

const GlobalStyle = createGlobalStyle<{colorScheme?: 'light' | 'dark'}>`
* { box-sizing: border-box; }
body { margin: 0; }
Expand Down Expand Up @@ -36,9 +39,6 @@ function BaseStyles(props: BaseStylesProps) {
const {children, ...rest} = props
const {colorScheme} = useTheme()

// load polyfill for :focus-visible
require('focus-visible')

return (
<Base {...rest} data-portal-root>
<GlobalStyle colorScheme={colorScheme?.includes('dark') ? 'dark' : 'light'} />
Expand Down