Skip to content

Commit bfdd74c

Browse files
committed
Update usage in code
1 parent ab87794 commit bfdd74c

File tree

27 files changed

+233
-226
lines changed

27 files changed

+233
-226
lines changed

examples/gatsby/src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReactNode } from 'react'
2-
import { ThemeProvider } from 'theme-ui'
2+
import { ThemeUIProvider } from 'theme-ui'
33
import { Themed, useThemedStylesWithMdx } from '@theme-ui/mdx'
44
import { MDXProvider, useMDXComponents } from '@mdx-js/react'
55
import theme from './theme'
@@ -8,10 +8,10 @@ export const WrapRootElement = ({ element }: { element: ReactNode }) => {
88
const components = useThemedStylesWithMdx(useMDXComponents())
99

1010
return (
11-
<ThemeProvider theme={theme}>
11+
<ThemeUIProvider theme={theme}>
1212
<MDXProvider components={components}>
1313
<Themed.root>{element}</Themed.root>
1414
</MDXProvider>
15-
</ThemeProvider>
15+
</ThemeUIProvider>
1616
)
1717
}

examples/next/pages/_app.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @jsxImportSource theme-ui */
2-
import { ThemeProvider } from 'theme-ui'
2+
import { ThemeUIProvider } from 'theme-ui'
33

44
import Header from '../components/Header'
55
import { theme } from '../lib/theme'
@@ -11,7 +11,7 @@ import type { AppProps } from 'next/app'
1111
*/
1212
export default function MyApp({ Component, pageProps }: AppProps) {
1313
return (
14-
<ThemeProvider theme={theme}>
14+
<ThemeUIProvider theme={theme}>
1515
<main
1616
sx={{
1717
border: '1px solid',
@@ -25,6 +25,6 @@ export default function MyApp({ Component, pageProps }: AppProps) {
2525
<Header />
2626
<Component {...pageProps} />
2727
</main>
28-
</ThemeProvider>
28+
</ThemeUIProvider>
2929
)
3030
}

examples/prism/src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react'
2-
import { ThemeProvider, Themed } from 'theme-ui'
2+
import { ThemeUIProvider, Themed } from 'theme-ui'
33
import theme from './theme'
44

55
export const WrapRootElement = ({ element }) => (
6-
<ThemeProvider theme={theme}>
6+
<ThemeUIProvider theme={theme}>
77
<Themed.root>{element}</Themed.root>
8-
</ThemeProvider>
8+
</ThemeUIProvider>
99
)

examples/typography/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { ReactNode } from 'react'
2-
import { ThemeProvider } from 'theme-ui'
2+
import { ThemeUIProvider } from 'theme-ui'
33

44
import theme from './theme'
55

66
export const WrapRootElement = ({ element }: { element: ReactNode }) => (
7-
<ThemeProvider theme={theme}>{element}</ThemeProvider>
7+
<ThemeUIProvider theme={theme}>{element}</ThemeUIProvider>
88
)

packages/components/test/Box.spec.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import React from 'react'
66
import { renderJSON, render, waitFor } from '@theme-ui/test-utils'
77

8-
import { ThemeProvider } from 'theme-ui'
8+
import { ThemeUIProvider } from 'theme-ui'
99

1010
import { Box } from '..'
1111

@@ -53,9 +53,9 @@ describe('Box', () => {
5353

5454
test('renders with variant prop', () => {
5555
const json = renderJSON(
56-
<ThemeProvider theme={theme}>
56+
<ThemeUIProvider theme={theme}>
5757
<Box variant="boxes.beep" />
58-
</ThemeProvider>
58+
</ThemeUIProvider>
5959
)
6060
expect(json).toHaveStyleRule('background-color', 'highlight')
6161
expect(json).toHaveStyleRule('padding', '32px')
@@ -82,13 +82,13 @@ describe('Box', () => {
8282

8383
test('renders with __themeKey variant', () => {
8484
const json = renderJSON(
85-
<ThemeProvider theme={theme}>
85+
<ThemeUIProvider theme={theme}>
8686
<Box
8787
// @ts-expect-error
8888
__themeKey="boxes"
8989
variant="beep"
9090
/>
91-
</ThemeProvider>
91+
</ThemeUIProvider>
9292
)
9393
expect(json).toHaveStyleRule('background-color', 'highlight')
9494
expect(json).toHaveStyleRule('padding', '32px')
@@ -98,9 +98,9 @@ describe('Box', () => {
9898
test('accepts ref', async () => {
9999
let ref: HTMLElement | null = null
100100
render(
101-
<ThemeProvider theme={theme}>
101+
<ThemeUIProvider theme={theme}>
102102
<Box ref={(r) => (ref = r)} />
103-
</ThemeProvider>
103+
</ThemeUIProvider>
104104
)
105105
await waitFor(() => {
106106
expect(ref).toBeTruthy()

packages/components/test/Button.spec.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import React from 'react'
66
import { renderJSON } from '@theme-ui/test-utils'
7-
import { ThemeProvider } from 'theme-ui'
7+
import { ThemeUIProvider } from 'theme-ui'
88

99
import { Button } from '..'
1010

@@ -13,17 +13,17 @@ import { theme } from './__test-utils__'
1313
describe('Button', () => {
1414
test('renders', () => {
1515
const json = renderJSON(
16-
<ThemeProvider theme={theme}>
16+
<ThemeUIProvider theme={theme}>
1717
<Button />
18-
</ThemeProvider>
18+
</ThemeUIProvider>
1919
)
2020
expect(json).toMatchSnapshot()
2121
})
2222
test('hidden', () => {
2323
const json = renderJSON(
24-
<ThemeProvider theme={theme}>
24+
<ThemeUIProvider theme={theme}>
2525
<Button hidden />
26-
</ThemeProvider>
26+
</ThemeUIProvider>
2727
)
2828
expect(json).toMatchSnapshot()
2929
})

packages/components/test/Flex.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
import React from 'react'
66
import { render } from '@theme-ui/test-utils'
7-
import { Flex, ThemeProvider } from 'theme-ui'
7+
import { Flex, ThemeUIProvider } from 'theme-ui'
88

99
test('accepts ref', async () => {
1010
let ref: HTMLElement | null = null
1111

1212
render(
13-
<ThemeProvider theme={{}}>
13+
<ThemeUIProvider theme={{}}>
1414
<Flex ref={(r) => (ref = r)} />
15-
</ThemeProvider>
15+
</ThemeUIProvider>
1616
)
1717

1818
expect(ref).toBeInstanceOf(HTMLDivElement)

packages/components/test/Grid.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import React from 'react'
66
import { renderJSON } from '@theme-ui/test-utils'
7-
import { ThemeProvider } from 'theme-ui'
7+
import { ThemeUIProvider } from 'theme-ui'
88

99
import { Grid } from '..'
1010

@@ -13,10 +13,10 @@ import { theme } from './__test-utils__'
1313
describe('Grid', () => {
1414
test('renders', () => {
1515
const json = renderJSON(
16-
<ThemeProvider theme={theme}>
16+
<ThemeUIProvider theme={theme}>
1717
<Grid />
1818
<Grid width="1fr" repeat="fit" />
19-
</ThemeProvider>
19+
</ThemeUIProvider>
2020
)
2121
expect(json).toMatchSnapshot()
2222
})

packages/components/test/SVG.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
import React from 'react'
66
import { render } from '@theme-ui/test-utils'
7-
import { ThemeProvider } from 'theme-ui'
7+
import { ThemeUIProvider } from 'theme-ui'
88
import { SVG } from '../src/SVG'
99

1010
test('accepts ref', async () => {
1111
let ref: SVGSVGElement | null = null
1212

1313
render(
14-
<ThemeProvider theme={{}}>
14+
<ThemeUIProvider theme={{}}>
1515
<SVG ref={(r) => (ref = r)} />
16-
</ThemeProvider>
16+
</ThemeUIProvider>
1717
)
1818

1919
expect(ref).toBeInstanceOf(SVGSVGElement)

0 commit comments

Comments
 (0)