Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Flyout leftovers #41129

Merged
merged 2 commits into from
May 18, 2022
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
40 changes: 22 additions & 18 deletions packages/components/src/item-group/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useCx } from '../../utils';
import { ItemGroup, Item } from '..';
import Button from '../../button';
import { FlexItem, FlexBlock } from '../../flex';
import { Flyout } from '../../flyout';
import Dropdown from '../../dropdown';
import { HStack } from '../../h-stack';
import Icon from '../../icon';
import { Text } from '../../text';
Expand Down Expand Up @@ -90,23 +90,27 @@ export const _default = () => {
};

export const dropdown = () => (
<Flyout
style={ { width: '350px' } }
trigger={ <Button>Open Popover</Button> }
>
<ItemGroup style={ { padding: 4 } }>
<Item>Code is Poetry (no click handlers)</Item>
<Item onClick={ () => alert( 'WordPress.org' ) }>
Code is Poetry — Click me!
</Item>
<Item onClick={ () => alert( 'WordPress.org' ) }>
Code is Poetry — Click me!
</Item>
<Item onClick={ () => alert( 'WordPress.org' ) }>
Code is Poetry — Click me!
</Item>
</ItemGroup>
</Flyout>
<Dropdown
renderToggle={ ( { isOpen, onToggle } ) => (
<Button onClick={ onToggle } aria-expanded={ isOpen }>
Open Popover
</Button>
) }
renderContent={ () => (
<ItemGroup style={ { minWidth: 350, padding: 4 } }>
<Item>Code is Poetry (no click handlers)</Item>
<Item onClick={ () => alert( 'WordPress.org' ) }>
Code is Poetry — Click me!
</Item>
<Item onClick={ () => alert( 'WordPress.org' ) }>
Code is Poetry — Click me!
</Item>
<Item onClick={ () => alert( 'WordPress.org' ) }>
Code is Poetry — Click me!
</Item>
</ItemGroup>
) }
/>
);

const SimpleColorSwatch = ( { color, style } ) => (
Expand Down
26 changes: 18 additions & 8 deletions packages/components/src/navigator/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { css } from '@emotion/react';
import Button from '../../button';
import { Card, CardBody, CardFooter, CardHeader } from '../../card';
import { HStack } from '../../h-stack';
import { Popover } from '../../popover';
import Dropdown from '../../dropdown';
import { useCx } from '../../utils/hooks/use-cx';
import {
NavigatorProvider,
Expand Down Expand Up @@ -54,13 +54,23 @@ const MyNavigation = () => {
Navigate to screen with sticky content.
</NavigatorButton>

<Button variant="primary">
Open test dialog
<Popover>
<CardHeader>Go</CardHeader>
<CardBody>Stuff</CardBody>
</Popover>
</Button>
<Dropdown
renderToggle={ ( { isOpen, onToggle } ) => (
<Button
onClick={ onToggle }
aria-expanded={ isOpen }
variant="primary"
>
Open test dialog
</Button>
) }
renderContent={ () => (
<Card>
<CardHeader>Go</CardHeader>
<CardBody>Stuff</CardBody>
</Card>
) }
/>
</HStack>
</CardBody>
</Card>
Expand Down
1 change: 0 additions & 1 deletion packages/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"src/dropdown-menu/**/*",
"src/elevation/**/*",
"src/flex/**/*",
"src/flyout/**/*",
"src/form-group/**/*",
"src/grid/**/*",
"src/h-stack/**/*",
Expand Down