diff --git a/.changeset/docs-drawerExample.md b/.changeset/docs-drawerExample.md deleted file mode 100644 index 708810666..000000000 --- a/.changeset/docs-drawerExample.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'react-magma-docs': patch ---- - -fix(Drawer): Fix Drawer Navigation example diff --git a/.changeset/docs-drawerExample2.md b/.changeset/docs-drawerExample2.md new file mode 100644 index 000000000..aba4aeab9 --- /dev/null +++ b/.changeset/docs-drawerExample2.md @@ -0,0 +1,5 @@ +--- +'react-magma-docs': patch +--- + +docs(Drawer): Fix Drawer examples diff --git a/packages/react-magma-dom/src/components/Drawer/Drawer.stories.tsx b/packages/react-magma-dom/src/components/Drawer/Drawer.stories.tsx index 01408bb99..28bcd6416 100644 --- a/packages/react-magma-dom/src/components/Drawer/Drawer.stories.tsx +++ b/packages/react-magma-dom/src/components/Drawer/Drawer.stories.tsx @@ -30,6 +30,7 @@ export const Default = args => { header="Drawer Title" onClose={() => setShowDrawer(false)} isOpen={showDrawer} + closeAriaLabel="Close drawer" {...args} >

This is a Drawer, doing Drawer things.

@@ -55,6 +56,7 @@ export const SiteNavigation = args => { isOpen={showDrawer} position={DrawerPosition.right} ariaLabel="Site Navigation Drawer" + closeAriaLabel="Close Navigation Drawer" > One diff --git a/website/react-magma-docs/src/pages/api/drawer.mdx b/website/react-magma-docs/src/pages/api/drawer.mdx index a0666650d..f65aa9364 100644 --- a/website/react-magma-docs/src/pages/api/drawer.mdx +++ b/website/react-magma-docs/src/pages/api/drawer.mdx @@ -17,7 +17,7 @@ Drawer accepts a position (top, right, bottom, or left) ```typescript import React from 'react'; -import { Button, Drawer, VisuallyHidden } from 'react-magma-dom'; +import { Button, Drawer, DrawerPosition, VisuallyHidden } from 'react-magma-dom'; export function Example() { const [showDrawer, setShowDrawer] = React.useState(false); @@ -25,10 +25,11 @@ export function Example() { return ( <> setShowDrawer(false)} isOpen={showDrawer} - position="bottom" + onClose={() => setShowDrawer(false)} + position={DrawerPosition.bottom} >

This is a Drawer, doing Drawer things.

@@ -49,11 +50,12 @@ export function Example() { ```typescript import React from 'react'; import { + Button, Drawer, DrawerPosition, - NavTabs, NavTab, - Button, + NavTabs, + TabsOrientation, VisuallyHidden, } from 'react-magma-dom'; export function Example() { @@ -63,8 +65,9 @@ export function Example() { <> setShowDrawer(false)} + closeAriaLabel="Close drawer" isOpen={showDrawer} + onClose={() => setShowDrawer(false)} position={DrawerPosition.right} > @@ -90,6 +93,7 @@ import React from 'react'; import { Button, Drawer, + DrawerPosition, VisuallyHidden, Card, CardBody, @@ -102,11 +106,12 @@ export function Example() { setShowDrawer(false)} - isOpen={showDrawer} - position="right" isInverse + isOpen={showDrawer} + onClose={() => setShowDrawer(false)} + position={DrawerPosition.right} >

This is a Drawer, doing Drawer things.

@@ -146,19 +151,18 @@ export function Example() { setShowDrawer(false)} isOpen={showDrawer} + onClose={() => setShowDrawer(false)} position={DrawerPosition.bottom} >

override default i18n value:

-

- -