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
2 changes: 1 addition & 1 deletion packages/react-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"tslib": "^2.8.1"
},
"devDependencies": {
"@patternfly/patternfly": "6.4.0",
"@patternfly/patternfly": "6.5.0-prerelease.3",
"case-anything": "^3.1.2",
"css": "^3.0.0",
"fs-extra": "^11.3.0"
Expand Down
13 changes: 12 additions & 1 deletion packages/react-core/src/components/ActionList/ActionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@ export interface ActionListProps extends React.HTMLProps<HTMLDivElement> {
isIconList?: boolean;
/** Additional classes added to the action list */
className?: string;
/** @beta Whether the layout of children is vertical or horizontal. */
isVertical?: boolean;
}

export const ActionList: React.FunctionComponent<ActionListProps> = ({
children,
isIconList,
className,
isVertical = false,
...props
}: ActionListProps) => (
<div className={css(styles.actionList, isIconList && styles.modifiers.icons, className)} {...props}>
<div
className={css(
styles.actionList,
isIconList && styles.modifiers.icons,
isVertical && styles.modifiers.vertical,
className
)}
{...props}
>
{children}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ test(`Renders with class ${styles.modifiers.icons} when isIconList is true`, ()
expect(screen.getByText('Test')).toHaveClass(styles.modifiers.icons);
});

test(`Does not render with class ${styles.modifiers.vertical} by default`, () => {
render(<ActionList>Test</ActionList>);

expect(screen.getByText('Test')).not.toHaveClass(styles.modifiers.vertical);
});

test(`Renders with class ${styles.modifiers.vertical} when isVertical is true`, () => {
render(<ActionList isVertical={true}>Test</ActionList>);

expect(screen.getByText('Test')).toHaveClass(styles.modifiers.vertical);
});

test('Renders with inherited element props spread to the component', () => {
render(<ActionList aria-label="Test label">Test</ActionList>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-ico
```ts file="./ActionListWithCancelButton.tsx"

```

### Vertical action list

```ts file="./ActionListVertical.tsx" isBeta

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { ActionList, ActionListGroup, ActionListItem, Button } from '@patternfly/react-core';
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';

export const ActionListVertical: React.FunctionComponent = () => (
<>
<h4>Multiple groups</h4>
<ActionList isVertical>
<ActionListGroup>
<ActionListItem>
<Button>Next</Button>
</ActionListItem>
<ActionListItem>
<Button variant="secondary">Back</Button>
</ActionListItem>
</ActionListGroup>
<ActionListGroup>
<ActionListItem>
<Button>Submit</Button>
</ActionListItem>
<ActionListItem>
<Button variant="link">Cancel</Button>
</ActionListItem>
</ActionListGroup>
</ActionList>
<h4>Icons, in two groups</h4>
<ActionList isVertical>
<ActionListGroup>
<ActionListItem>
<Button aria-label="Close vertical action list group 1" variant="plain" icon={<TimesIcon />} />
</ActionListItem>
<ActionListItem>
<Button aria-label="Toggle vertical action list example group 1" variant="plain" icon={<CheckIcon />} />
</ActionListItem>
</ActionListGroup>
<ActionListGroup>
<ActionListItem>
<Button aria-label="Close vertical action list group 2" variant="plain" icon={<TimesIcon />} />
</ActionListItem>
<ActionListItem>
<Button aria-label="Toggle vertical action list example group 2" variant="plain" icon={<CheckIcon />} />
</ActionListItem>
</ActionListGroup>
</ActionList>
</>
);
2 changes: 1 addition & 1 deletion packages/react-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test:a11y": "patternfly-a11y --config patternfly-a11y.config"
},
"dependencies": {
"@patternfly/patternfly": "6.4.0",
"@patternfly/patternfly": "6.5.0-prerelease.3",
"@patternfly/react-charts": "workspace:^",
"@patternfly/react-code-editor": "workspace:^",
"@patternfly/react-core": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@fortawesome/free-brands-svg-icons": "^5.15.4",
"@fortawesome/free-regular-svg-icons": "^5.15.4",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@patternfly/patternfly": "6.4.0",
"@patternfly/patternfly": "6.5.0-prerelease.3",
"fs-extra": "^11.3.0",
"tslib": "^2.8.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/react-styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf dist css"
},
"devDependencies": {
"@patternfly/patternfly": "6.4.0",
"@patternfly/patternfly": "6.5.0-prerelease.3",
"change-case": "^5.4.4",
"fs-extra": "^11.3.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"clean": "rimraf dist"
},
"devDependencies": {
"@adobe/css-tools": "^4.4.4",
"@patternfly/patternfly": "6.4.0",
"@adobe/css-tools": "^4.4.2",
"@patternfly/patternfly": "6.5.0-prerelease.3",
"fs-extra": "^11.3.0"
}
}
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ __metadata:
languageName: node
linkType: hard

"@adobe/css-tools@npm:^4.4.4":
version: 4.4.4
resolution: "@adobe/css-tools@npm:4.4.4"
checksum: 10c0/8f3e6cfaa5e6286e6f05de01d91d060425be2ebaef490881f5fe6da8bbdb336835c5d373ea337b0c3b0a1af4be048ba18780f0f6021d30809b4545922a7e13d9
"@adobe/css-tools@npm:^4.4.2":
version: 4.4.3
resolution: "@adobe/css-tools@npm:4.4.3"
checksum: 10c0/6d16c4d4b6752d73becf6e58611f893c7ed96e04017ff7084310901ccdbe0295171b722b158f6a2b0aa77182ef3446ffd62b39488fa5a7adab1f0dfe5ffafbae
languageName: node
linkType: hard

Expand Down Expand Up @@ -4318,10 +4318,10 @@ __metadata:
languageName: node
linkType: hard

"@patternfly/patternfly@npm:6.4.0":
version: 6.4.0
resolution: "@patternfly/patternfly@npm:6.4.0"
checksum: 10c0/255c22e04a7649c9373790dbc66f97e2f01a121a843d3bc27627596f35296cc7f2228447d5866f63f17bccd36bae24ec68c45e1572778285dea617086d309737
"@patternfly/patternfly@npm:6.5.0-prerelease.3":
version: 6.5.0-prerelease.3
resolution: "@patternfly/patternfly@npm:6.5.0-prerelease.3"
checksum: 10c0/673d6822de21bfac92cb872389b52615dd808d0c8b11d30c3bd57e36a03cfaa5f17da27f5a23d36cecaa55beb801c64457c123192546e1179825fd6745a8abb3
languageName: node
linkType: hard

Expand Down Expand Up @@ -4419,7 +4419,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@patternfly/react-core@workspace:packages/react-core"
dependencies:
"@patternfly/patternfly": "npm:6.4.0"
"@patternfly/patternfly": "npm:6.5.0-prerelease.3"
"@patternfly/react-icons": "workspace:^"
"@patternfly/react-styles": "workspace:^"
"@patternfly/react-tokens": "workspace:^"
Expand All @@ -4440,7 +4440,7 @@ __metadata:
resolution: "@patternfly/react-docs@workspace:packages/react-docs"
dependencies:
"@patternfly/documentation-framework": "npm:^6.22.8"
"@patternfly/patternfly": "npm:6.4.0"
"@patternfly/patternfly": "npm:6.5.0-prerelease.3"
"@patternfly/patternfly-a11y": "npm:5.1.0"
"@patternfly/react-charts": "workspace:^"
"@patternfly/react-code-editor": "workspace:^"
Expand Down Expand Up @@ -4480,7 +4480,7 @@ __metadata:
"@fortawesome/free-brands-svg-icons": "npm:^5.15.4"
"@fortawesome/free-regular-svg-icons": "npm:^5.15.4"
"@fortawesome/free-solid-svg-icons": "npm:^5.15.4"
"@patternfly/patternfly": "npm:6.4.0"
"@patternfly/patternfly": "npm:6.5.0-prerelease.3"
fs-extra: "npm:^11.3.0"
tslib: "npm:^2.8.1"
peerDependencies:
Expand Down Expand Up @@ -4565,7 +4565,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@patternfly/react-styles@workspace:packages/react-styles"
dependencies:
"@patternfly/patternfly": "npm:6.4.0"
"@patternfly/patternfly": "npm:6.5.0-prerelease.3"
change-case: "npm:^5.4.4"
fs-extra: "npm:^11.3.0"
languageName: unknown
Expand Down Expand Up @@ -4606,8 +4606,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@patternfly/react-tokens@workspace:packages/react-tokens"
dependencies:
"@adobe/css-tools": "npm:^4.4.4"
"@patternfly/patternfly": "npm:6.4.0"
"@adobe/css-tools": "npm:^4.4.2"
"@patternfly/patternfly": "npm:6.5.0-prerelease.3"
fs-extra: "npm:^11.3.0"
languageName: unknown
linkType: soft
Expand Down