Skip to content

Commit bca2d1c

Browse files
jacobloganJacob Logan
andauthored
re export amplify provider as theme provider and update all documenta… (#1956)
* re export amplify provider as theme provider and update all documentation to use theme provider * rename amplify provider type to theme provider type * update exports snapshot with themeprovider * Create flat-dryers-nail.md * add an info alert warning of the AmplifyProvider rename * rename AmplifyProvider folder to ThemeProvider, update tests Co-authored-by: Jacob Logan <[email protected]>
1 parent 8427e3f commit bca2d1c

File tree

47 files changed

+197
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+197
-144
lines changed

.changeset/flat-dryers-nail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aws-amplify/ui-react": patch
3+
---
4+
5+
re export AmplifyProvider as ThemeProvider

docs/src/components/ThemeAlert.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Alert } from '@aws-amplify/ui-react';
2+
3+
export const ThemeAlert = () => {
4+
return (
5+
<Alert variation="info">
6+
AmplifyProvider has been renamed to ThemeProvider. The ThemeProvider
7+
export is available since version 2.18.3, previous versions must still use
8+
AmplifyProvider.
9+
</Alert>
10+
);
11+
};

docs/src/pages/[platform]/components/authenticator/AuthStyle.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
Authenticator,
3-
AmplifyProvider,
3+
ThemeProvider,
44
Theme,
55
useTheme,
66
} from '@aws-amplify/ui-react';
@@ -57,8 +57,8 @@ export function AuthStyle() {
5757
};
5858

5959
return (
60-
<AmplifyProvider theme={theme}>
60+
<ThemeProvider theme={theme}>
6161
<Authenticator></Authenticator>
62-
</AmplifyProvider>
62+
</ThemeProvider>
6363
);
6464
}

docs/src/pages/[platform]/components/authenticator/customization.styling.react.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { AuthStyle } from './AuthStyle';
22
import { Example } from '@/components/Example';
33

4-
#### Amplify Provider Theme
4+
#### Theme Provider Theme
55

6-
You can update the style of the Authenticator by using the [AmplifyProvider](/theming/react) [theme object](/theming/react#theme-object). To do this, you must surround the `Authenticator` in the `AmplifyProvider`.
6+
You can update the style of the Authenticator by using the [ThemeProvider](/theming/react) [theme object](/theming/react#theme-object). To do this, you must surround the `Authenticator` in the `ThemeProvider`.
77

8-
Then create a [theme object](/theming/react#theme-object), with all your font and color updates. Feel free to use [design tokens](/theming/react#design-tokens), as a way of desiging your theme further.
8+
Then create a [theme object](/theming/react#theme-object), with all your font and color updates. Feel free to use [design tokens](/theming/react#design-tokens), as a way of designing your theme further.
99

1010
Below is an example of changing the default colors to a dark theme.
1111

docs/src/pages/[platform]/components/authenticator/customization.styling.web.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Authenticator, AmplifyProvider } from '@aws-amplify/ui-react';
1+
import { Authenticator, ThemeProvider } from '@aws-amplify/ui-react';
22
import { AuthStyle } from './AuthStyle';
33

44
import { Example } from '@/components/Example';

docs/src/pages/[platform]/components/button/examples/ButtonThemeExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Flex, Button, AmplifyProvider } from '@aws-amplify/ui-react';
1+
import { Flex, Button, ThemeProvider } from '@aws-amplify/ui-react';
22

33
const theme = {
44
name: 'button-theme',
@@ -26,11 +26,11 @@ const theme = {
2626
};
2727

2828
export const ButtonThemeExample = () => (
29-
<AmplifyProvider theme={theme}>
29+
<ThemeProvider theme={theme}>
3030
<Flex direction="row">
3131
<Button>Default</Button>
3232
<Button variation="primary">Primary</Button>
3333
<Button variation="link">Link</Button>
3434
</Flex>
35-
</AmplifyProvider>
35+
</ThemeProvider>
3636
);

docs/src/pages/[platform]/components/button/react.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Example, ExampleCode } from '@/components/Example';
33
import { ComponentClassTable } from '@/components/ComponentClassTable';
44
import StandardHTMLAttributes from '@/components/StandardHTMLAttributes.mdx';
55
import { ComponentStyleDisplay } from '@/components/ComponentStyleDisplay';
6+
import { ThemeAlert } from '@/components/ThemeAlert';
67

78
import { ButtonDemo } from './demo';
89
import { IconButtonExample, ButtonThemeExample } from './examples';
@@ -269,6 +270,8 @@ import '@aws-amplify/ui-react/styles.css';
269270

270271
### Theme
271272

273+
<ThemeAlert />
274+
272275
You can customize the appearance of all Buttons in your application with a [Theme](/theming).
273276

274277
<Example>

docs/src/pages/[platform]/components/card/examples/CardThemeExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AmplifyProvider, Card, Text, Flex } from '@aws-amplify/ui-react';
1+
import { ThemeProvider, Card, Text, Flex } from '@aws-amplify/ui-react';
22

33
const cardTheme = {
44
name: 'card-theme',
@@ -21,7 +21,7 @@ const cardTheme = {
2121

2222
export const CardThemeExample = () => {
2323
return (
24-
<AmplifyProvider theme={cardTheme}>
24+
<ThemeProvider theme={cardTheme}>
2525
<Flex direction="row">
2626
<Card>
2727
<Text>Hello</Text>
@@ -33,6 +33,6 @@ export const CardThemeExample = () => {
3333
<Text>Hello</Text>
3434
</Card>
3535
</Flex>
36-
</AmplifyProvider>
36+
</ThemeProvider>
3737
);
3838
};

docs/src/pages/[platform]/components/card/react.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@aws-amplify/ui-react';
99
import { Example, ExampleCode } from '@/components/Example';
1010
import { ComponentStyleDisplay } from '@/components/ComponentStyleDisplay';
11+
import { ThemeAlert } from '@/components/ThemeAlert';
1112

1213
import { CardDemo } from './demo.tsx';
1314
import {
@@ -77,6 +78,8 @@ The Card component renders as a `div` by default. You can change the HTML elemen
7778

7879
### Theme
7980

81+
<ThemeAlert />
82+
8083
<Example>
8184
<CardThemeExample />
8285

docs/src/pages/[platform]/components/divider/examples/DividerThemeExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Flex, Text, Divider, AmplifyProvider } from '@aws-amplify/ui-react';
1+
import { Flex, Text, Divider, ThemeProvider } from '@aws-amplify/ui-react';
22

33
const theme = {
44
name: 'divider-theme',
@@ -18,12 +18,12 @@ const theme = {
1818
};
1919

2020
export const DividerThemeExample = () => (
21-
<AmplifyProvider theme={theme}>
21+
<ThemeProvider theme={theme}>
2222
<Flex direction="column">
2323
<Text>Before</Text>
2424
<Divider />
2525
<Text>After</Text>
2626
<Divider size="large" />
2727
</Flex>
28-
</AmplifyProvider>
28+
</ThemeProvider>
2929
);

0 commit comments

Comments
 (0)