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
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,35 @@ propComponents: ['ActionList', 'ActionListGroup', 'ActionListItem']

import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
import {
Dropdown as DropdownDeprecated,
DropdownItem as DropdownItemDeprecated,
DropdownSeparator,
KebabToggle
} from '@patternfly/react-core/deprecated';

## Examples

### Action list single group

```ts file="ActionListSingleGroup.tsx"

```

### Action list with icons

```ts file="./ActionListWithIcons.tsx"

```

### Action list multiple groups

```ts file="./ActionListMultipleGroups.tsx"

```

### Action list with cancel button

```ts file="./ActionListWithCancelButton.tsx"

```
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react';
import { ActionList, ActionListItem, Button } from '@patternfly/react-core';
import {
ActionList,
ActionListItem,
Button,
Dropdown,
DropdownItem,
Dropdown as DropdownDeprecated,
DropdownItem as DropdownItemDeprecated,
DropdownSeparator,
KebabToggle
} from '@patternfly/react-core';
} from '@patternfly/react-core/deprecated';

export const ActionListSingleGroup: React.FunctionComponent = () => {
const [isOpen, setIsOpen] = React.useState(false);
Expand All @@ -26,21 +24,21 @@ export const ActionListSingleGroup: React.FunctionComponent = () => {
};

const dropdownItems = [
<DropdownItem key="link">Link</DropdownItem>,
<DropdownItem key="action" component="button">
<DropdownItemDeprecated key="link">Link</DropdownItemDeprecated>,
<DropdownItemDeprecated key="action" component="button">
Action
</DropdownItem>,
<DropdownItem key="disabled link" isDisabled>
</DropdownItemDeprecated>,
<DropdownItemDeprecated key="disabled link" isDisabled>
Disabled Link
</DropdownItem>,
<DropdownItem key="disabled action" isDisabled component="button">
</DropdownItemDeprecated>,
<DropdownItemDeprecated key="disabled action" isDisabled component="button">
Disabled Action
</DropdownItem>,
</DropdownItemDeprecated>,
<DropdownSeparator key="separator" />,
<DropdownItem key="separated link">Separated Link</DropdownItem>,
<DropdownItem key="separated action" component="button">
<DropdownItemDeprecated key="separated link">Separated Link</DropdownItemDeprecated>,
<DropdownItemDeprecated key="separated action" component="button">
Separated Action
</DropdownItem>
</DropdownItemDeprecated>
];

return (
Expand Down Expand Up @@ -71,7 +69,7 @@ export const ActionListSingleGroup: React.FunctionComponent = () => {
</Button>
</ActionListItem>
<ActionListItem>
<Dropdown
<DropdownDeprecated
onSelect={onSelect}
toggle={<KebabToggle onToggle={onToggle} />}
isOpen={isOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ import * as React from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher';
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
import { DropdownDirection, DropdownPosition, DropdownToggle, DropdownContext } from '../Dropdown';
import { DropdownWithContext } from '../Dropdown/DropdownWithContext';
import {
DropdownDirection,
DropdownPosition,
DropdownToggle,
DropdownContext
} from '../../deprecated/components/Dropdown';
import { DropdownWithContext } from '../../deprecated/components/Dropdown/DropdownWithContext';
import { ApplicationLauncherGroup } from './ApplicationLauncherGroup';
import { ApplicationLauncherSeparator } from './ApplicationLauncherSeparator';
import { ApplicationLauncherItem } from './ApplicationLauncherItem';
Expand Down Expand Up @@ -94,13 +99,7 @@ export class ApplicationLauncher extends React.Component<ApplicationLauncherProp
return (
<div key="search" className={css(styles.appLauncherMenuSearch)}>
<ApplicationLauncherItem
customChild={
<SearchInput
placeholder={searchPlaceholderText}
onChange={onSearch}
{...searchProps}
/>
}
customChild={<SearchInput placeholder={searchPlaceholderText} onChange={onSearch} {...searchProps} />}
></ApplicationLauncherItem>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { DropdownGroup, DropdownGroupProps } from '../Dropdown';
import { DropdownGroup, DropdownGroupProps } from '../../deprecated/components/Dropdown';

export const ApplicationLauncherGroup: React.FunctionComponent<DropdownGroupProps> = ({
children,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher';
import { DropdownItem, DropdownItemProps } from '../Dropdown';
import { DropdownItem, DropdownItemProps } from '../../deprecated/components/Dropdown';
import { ApplicationLauncherContent } from './ApplicationLauncherContent';
import { ApplicationLauncherContext } from './ApplicationLauncherContext';
import { ApplicationLauncherItemContext } from './ApplicationLauncherItemContext';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { DropdownSeparator, SeparatorProps } from '../Dropdown/DropdownSeparator';
import { DropdownSeparator, SeparatorProps } from '../../deprecated/components/Dropdown/DropdownSeparator';

export const ApplicationLauncherSeparator: React.FunctionComponent<SeparatorProps> = ({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
import { ApplicationLauncher } from '../ApplicationLauncher';
import { ApplicationLauncherItem } from '../ApplicationLauncherItem';

import { DropdownPosition, DropdownDirection } from '../../Dropdown/dropdownConstants';
import { DropdownPosition, DropdownDirection } from '../../../deprecated/components/Dropdown/dropdownConstants';
import { ApplicationLauncherSeparator } from '../ApplicationLauncherSeparator';

const dropdownItems = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { render } from '@testing-library/react';

import { ApplicationLauncherSeparator } from '../../ApplicationLauncherSeparator';
import { DropdownArrowContext } from '../../../Dropdown/dropdownConstants';
import { DropdownArrowContext } from '../../../../deprecated/components/Dropdown/dropdownConstants';

describe('ApplicationLauncherSeparator', () => {
it('should match snapshot', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ propComponents: ['ApplicationLauncher', 'ApplicationLauncherItem', 'ApplicationL
ouia: true
---

import { DropdownDirection, DropdownPosition } from '@patternfly/react-core/deprecated';
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
import { Link } from '@reach/router';
import pfLogoSm from './pf-logo-small.svg';
Expand All @@ -18,49 +19,59 @@ To add a tooltip, use the `tooltip` prop and optionally add more tooltip props b
### Basic

```ts file="./ApplicationLauncherBasic.tsx"

```

### Router link

```ts file="./ApplicationLauncherRouterLink.tsx"

```

### Disabled

```ts file="./ApplicationLauncherDisabled.tsx"

```

### Aligned right

```ts file="./ApplicationLauncherAlignRight.tsx"

```

### Aligned top

```ts file="./ApplicationLauncherAlignTop.tsx"

```

### With tooltip

```ts file="./ApplicationLauncherTooltip.tsx"

```

### With sections and icons

```ts file="./ApplicationLauncherSectionsAndIcons.tsx"

```

### With favorites and search

```ts file="./ApplicationLauncherFavoritesAndSearch.tsx"

```

### With custom icon

```ts file="./ApplicationLauncherCustomIcon.tsx"

```

### Basic with menu appended to document body

```ts file="./ApplicationLauncherDocumentBody.tsx"

```
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { ApplicationLauncher, ApplicationLauncherItem, DropdownPosition } from '@patternfly/react-core';
import { ApplicationLauncher, ApplicationLauncherItem } from '@patternfly/react-core';
import { DropdownPosition } from '@patternfly/react-core/deprecated';

const appLauncherItems: React.ReactElement[] = [
<ApplicationLauncherItem key="application_1a" href="#">
Expand All @@ -17,7 +18,7 @@ export const ApplicationLauncherAlignRight: React.FunctionComponent = () => {
const [isOpen, setIsOpen] = React.useState(false);

const onToggle = (_event: any, isOpen: boolean) => setIsOpen(isOpen);
const onSelect = (_event: any) => setIsOpen(prevIsOpen => !prevIsOpen);
const onSelect = (_event: any) => setIsOpen((prevIsOpen) => !prevIsOpen);

return (
<ApplicationLauncher
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { ApplicationLauncher, ApplicationLauncherItem, DropdownDirection } from '@patternfly/react-core';
import { ApplicationLauncher, ApplicationLauncherItem } from '@patternfly/react-core';
import { DropdownDirection } from '@patternfly/react-core/deprecated';

const appLauncherItems: React.ReactElement[] = [
<ApplicationLauncherItem key="application_1a" href="#">
Expand All @@ -17,7 +18,7 @@ export const ApplicationLauncherAlignTop: React.FunctionComponent = () => {
const [isOpen, setIsOpen] = React.useState(false);

const onToggle = (_event: any, isOpen: boolean) => setIsOpen(isOpen);
const onSelect = (_event: any) => setIsOpen(prevIsOpen => !prevIsOpen);
const onSelect = (_event: any) => setIsOpen((prevIsOpen) => !prevIsOpen);

return (
<ApplicationLauncher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,35 @@ propComponents: ['Breadcrumb', 'BreadcrumbItem', 'BreadcrumbHeading']
ouia: true
---

import {
Dropdown as DropdownDeprecated,
BadgeToggle,
DropdownItem as DropdownItemDeprecated
} from '@patternfly/react-core/deprecated';
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';

## Examples

### Basic

```ts file="./BreadcrumbBasic.tsx"

```

### Without home link

```ts file="./BreadcrumbWithoutHomeLink.tsx"

```

### With heading

```ts file="./BreadcrumbWithHeading.tsx"

```

### With dropdown

```ts file="./BreadcrumbDropdown.tsx"

```
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import React from 'react';
import { Breadcrumb, BreadcrumbItem, BreadcrumbHeading } from '@patternfly/react-core';
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbHeading,
Dropdown,
Dropdown as DropdownDeprecated,
BadgeToggle,
DropdownItem
} from '@patternfly/react-core';
DropdownItem as DropdownItemDeprecated
} from '@patternfly/react-core/deprecated';
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';

const dropdownItems: JSX.Element[] = [
<DropdownItem key="edit" component="button" icon={<AngleLeftIcon />}>
<DropdownItemDeprecated key="edit" component="button" icon={<AngleLeftIcon />}>
Edit
</DropdownItem>,
<DropdownItem key="action" component="button" icon={<AngleLeftIcon />}>
</DropdownItemDeprecated>,
<DropdownItemDeprecated key="action" component="button" icon={<AngleLeftIcon />}>
Deployment
</DropdownItem>,
<DropdownItem key="apps" component="button" icon={<AngleLeftIcon />}>
</DropdownItemDeprecated>,
<DropdownItemDeprecated key="apps" component="button" icon={<AngleLeftIcon />}>
Applications
</DropdownItem>
</DropdownItemDeprecated>
];

export const BreadcrumbDropdown: React.FunctionComponent = () => {
Expand All @@ -36,7 +34,7 @@ export const BreadcrumbDropdown: React.FunctionComponent = () => {
<Breadcrumb>
<BreadcrumbItem component="button">Section home</BreadcrumbItem>
<BreadcrumbItem isDropdown>
<Dropdown
<DropdownDeprecated
onSelect={onSelect}
toggle={
<BadgeToggle ref={badgeToggleRef} onToggle={onToggle}>
Expand Down
Loading