Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a739a85
chore(deps-dev): bump caniuse-lite from 1.0.30001643 to 1.0.30001649 …
dependabot[bot] Aug 7, 2024
7fb073c
chore(deps-dev): bump @babel/preset-env from 7.24.8 to 7.25.3 (#254)
dependabot[bot] Aug 7, 2024
5c4b9c9
chore(deps-dev): bump @types/connect-history-api-fallback (#252)
dependabot[bot] Aug 7, 2024
6aefe02
chore(deps-dev): bump readable-stream from 1.0.34 to 2.3.8 (#251)
dependabot[bot] Aug 7, 2024
bbfb51e
fix(ServiceCard): Add horizontal layout to the ServiceCard (#260)
fhlavac Aug 12, 2024
1dc92b9
chore(deps-dev): bump acorn-walk from 8.2.0 to 8.3.3 (#269)
dependabot[bot] Aug 13, 2024
1f7369c
chore(deps-dev): bump rimraf from 5.0.7 to 5.0.10 (#271)
dependabot[bot] Aug 13, 2024
ae76708
make subtitle prop optional (#261)
InsaneZein Aug 13, 2024
858132a
chore(deps-dev): bump chrome-trace-event from 1.0.3 to 1.0.4 (#270)
dependabot[bot] Aug 13, 2024
ceb5f0f
chore(deps-dev): bump memfs from 3.5.1 to 3.5.3 (#268)
dependabot[bot] Aug 13, 2024
e4b62c2
chore(deps-dev): bump @types/eslint from 8.40.0 to 9.6.0 (#267)
dependabot[bot] Aug 13, 2024
f28e760
chore(deps-dev): bump regenerate-unicode-properties (#266)
dependabot[bot] Aug 13, 2024
10b7dc5
chore(deps-dev): bump eslint-plugin-promise from 6.4.0 to 6.6.0 (#265)
dependabot[bot] Aug 13, 2024
1e7d474
chore(deps-dev): bump nwsapi from 2.2.5 to 2.2.12 (#262)
dependabot[bot] Aug 13, 2024
2a5786c
chore(deps-dev): bump @babel/plugin-transform-typescript (#263)
dependabot[bot] Aug 13, 2024
1490db7
chore(deps-dev): bump escodegen from 2.0.0 to 2.1.0 (#264)
dependabot[bot] Aug 13, 2024
1353a73
Update to PatternFly 6 (#145)
fhlavac Jun 17, 2024
8cea371
Update to the latest PF versions (#224)
fhlavac Jul 30, 2024
5b81728
fix(v6): Fix generated files
fhlavac Aug 1, 2024
8fafde9
fix(pf6): Rebase to the latest main (#259)
fhlavac Aug 16, 2024
b2caf71
Update examples
fhlavac Aug 18, 2024
f3be1da
fix(pf6): Fix MCC example
fhlavac Aug 18, 2024
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,271 changes: 981 additions & 1,290 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"eslint-plugin-markdown": "^1.0.2",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.4.0",
"eslint-plugin-promise": "^6.6.0",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"fs-extra": "^11.2.0",
Expand All @@ -71,7 +71,7 @@
"prettier": "3.3.2",
"react": "^18",
"react-dom": "^18",
"rimraf": "^5.0.7",
"rimraf": "^5.0.10",
"sass": "^1.77.6",
"sass-loader": "^14.2.1",
"serve": "^14.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import MultiContentCard from "@patternfly/react-component-groups/dist/dynamic/MultiContentCard";
import { Button, Card, CardHeader, CardBody, Content, ContentVariants, List, ListItem, Icon, CardFooter } from '@patternfly/react-core';
import { Button, Card, CardHeader, CardBody, CardFooter, List, ListItem, Content, ContentVariants, Icon } from '@patternfly/react-core';
import { ArrowRightIcon, BellIcon, CogIcon, LockIcon } from '@patternfly/react-icons';
import { createUseStyles } from 'react-jss';
import clsx from 'clsx';

const useStyles = createUseStyles({
action: {
color: 'var(--pf-t--global--text--color--brand--default)',
fontSize: 'var(-pf-t--global--font--size--sm)',
fontSize: 'var(--pf-t--global--font--size--sm)',
},
actionIcon: {
color: 'var(--pf-t--global--icon--color--regular)',
Expand All @@ -17,9 +17,9 @@ const useStyles = createUseStyles({
color: 'var(--pf-t--global--color--brand--default)',
},
});

export const BasicExample: React.FunctionComponent = () => {
const classes = useStyles();

const cards = [
<Card isFullHeight isPlain key="card-1">
<CardHeader>
Expand All @@ -30,10 +30,10 @@ export const BasicExample: React.FunctionComponent = () => {
<Icon size="md" className="pf-v6-u-pl-sm pf-v6-u-pr-md">
<CogIcon className={classes.actionIcon} />
</Icon>
Configure application
Configure application
</Content>
<Content className="pf-v6-u-font-size-sm">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</Content>
</CardBody>
<CardFooter>
Expand All @@ -51,21 +51,22 @@ export const BasicExample: React.FunctionComponent = () => {
</CardFooter>
</Card>,
<Card isFullHeight isPlain key="card-2">
<CardHeader style={{ visibility: 'hidden' }}>-</CardHeader>
<CardBody>
<Content className={clsx(classes.action, 'pf-v6-u-font-weight-bold', 'pf-v6-u-mb-sm')}>
<Icon size="md" className="pf-v6-u-pl-sm pf-v6-u-pr-md">
<LockIcon className={classes.actionIcon} />
</Icon>
Configure access
Configure access
</Content>
<Content>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
<Content className="pf-v6-u-font-size-sm">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</Content>
</CardBody>
<CardFooter>
<Content>
<Button variant="link" isInline>
Learn more
Learn more
<Icon className="pf-v6-u-ml-sm" isInline>
<ArrowRightIcon />
</Icon>
Expand All @@ -82,16 +83,16 @@ export const BasicExample: React.FunctionComponent = () => {
<Icon size="md" className="pf-v6-u-pl-sm pf-v6-u-pr-md">
<BellIcon className={classes.actionIcon} />
</Icon>
Configure notifications
Configure notifications
</Content>
<Content>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<Content className="pf-v6-u-font-size-sm">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</Content>
</CardBody>
<CardFooter>
<Content>
<Button variant="link" isInline>
Learn more
Learn more
<Icon className="pf-v6-u-ml-sm" isInline>
<ArrowRightIcon />
</Icon>
Expand All @@ -101,5 +102,5 @@ export const BasicExample: React.FunctionComponent = () => {
</Card>
];

return(<MultiContentCard cards={cards} />)
};
return(<MultiContentCard cards={cards} />);
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React from 'react';
import MultiContentCard from "@patternfly/react-component-groups/dist/dynamic/MultiContentCard";
import { EllipsisVIcon } from '@patternfly/react-icons';
import { Button, Card, CardHeader, CardBody, CardFooter, Content, ContentVariants, List, ListItem, Icon, Divider, Dropdown, DropdownItem, DropdownList, MenuToggle, MenuToggleElement, Label } from '@patternfly/react-core';
import { ArrowRightIcon, BellIcon, CogIcon, LockIcon, EllipsisVIcon } from '@patternfly/react-icons';
import { ArrowRightIcon, BellIcon, CogIcon, LockIcon } from '@patternfly/react-icons';
import { createUseStyles } from 'react-jss';
import clsx from 'clsx';

const useStyles = createUseStyles({
cardHeaderTitle: {
fontSize: 'var(--pf-t--global--font--size--heading--h4)',
},
bulletPoints: {
color: 'var(--pf-t--global--color--brand--default)',
},
Expand All @@ -20,11 +18,11 @@ export const BasicExample: React.FunctionComponent = () => {

const cards = [
<Card isFullHeight isPlain key="card-1">
<CardHeader className="pf-v6-u-pt-0">
<Content component={ContentVariants.h3} className={classes.cardHeaderTitle}>Getting Started</Content>
<CardHeader className="pf-v6-u-pt-0">
<Content component={ContentVariants.h4}>Getting Started</Content>
</CardHeader>
<CardBody>
<Label className='pf-v6-u-mb-sm' icon={<CogIcon />} color="blue">
<Label className="pf-v6-u-mb-sm" icon={<CogIcon />} color="blue">
Configure application
</Label>
<Content className="pf-v6-u-font-size-sm">
Expand All @@ -46,9 +44,9 @@ export const BasicExample: React.FunctionComponent = () => {
</CardFooter>
</Card>,
<Card isFullHeight isPlain key="card-2">
<CardHeader/>
<CardHeader className="pf-v6-u-pt-0" style={{ visibility: 'hidden' }}>-</CardHeader>
<CardBody>
<Label className='pf-v6-u-mb-sm' icon={<LockIcon />} color="green">
<Label className="pf-v6-u-mb-sm" icon={<LockIcon />} color="green">
Configure access
</Label>
<Content className="pf-v6-u-font-size-sm">
Expand All @@ -68,10 +66,10 @@ export const BasicExample: React.FunctionComponent = () => {
</Card>,
<Card isFullHeight isPlain key="card-3">
<CardHeader className="pf-v6-u-pt-0">
<Content component={ContentVariants.h3} className={classes.cardHeaderTitle}>Next Steps</Content>
<Content component={ContentVariants.h4}>Next Steps</Content>
</CardHeader>
<CardBody>
<Label className='pf-v6-u-mb-sm' icon={<BellIcon />} color="orange">
<Label className="pf-v6-u-mb-sm" icon={<BellIcon />} color="orange">
Configure notifications
</Label>
<Content className="pf-v6-u-font-size-sm">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import clsx from 'clsx';
const useStyles = createUseStyles({
action: {
color: 'var(--pf-t--global--text--color--brand--default)',
fontSize: 'var(-pf-t--global--font--size--sm)',
fontSize: 'var(--pf-t--global--font--size--sm)',
},
actionIcon: {
color: 'var(--pf-t--global--icon--color--regular)',
Expand Down Expand Up @@ -52,7 +52,7 @@ export const BasicExample: React.FunctionComponent = () => {
</CardFooter>
</Card>,
<Card isFullHeight isPlain key="card-2">
<CardHeader/>
<CardHeader className='pf-v6-u-pt-0' style={{ visibility: 'hidden' }}>-</CardHeader>
<CardBody>
<Content className={clsx(classes.action, 'pf-v6-u-font-weight-bold', 'pf-v6-u-mb-sm')}>
<Icon size="md" className="pf-v6-u-pl-sm pf-v6-u-pr-md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const BasicExample: React.FunctionComponent = () => {
</CardFooter>
</Card>,
<Card isFullHeight isPlain key="card-2">
<CardHeader/>
<CardHeader className='pf-v6-u-pt-0' style={{ visibility: 'hidden' }}>-</CardHeader>
<CardBody>
<Content className={clsx(classes.action, 'pf-v6-u-font-weight-bold', 'pf-v6-u-mb-sm')}>
<Icon size="md" className="pf-v6-u-pl-sm pf-v6-u-pr-md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import clsx from 'clsx';
const useStyles = createUseStyles({
action: {
color: 'var(--pf-t--global--text--color--brand--default)',
fontSize: 'var(-pf-t--global--font--size--sm)',
fontSize: 'var(--pf-t--global--font--size--sm)',
},
actionIcon: {
color: 'var(--pf-t--global--icon--color--regular)',
Expand Down Expand Up @@ -52,7 +52,7 @@ export const BasicExample: React.FunctionComponent = () => {
</CardFooter>
</Card>,
<Card isFullHeight isPlain key="card-2">
<CardHeader/>
<CardHeader className='pf-v6-u-pt-0' style={{ visibility: 'hidden' }}>-</CardHeader>
<CardBody>
<Content className={clsx(classes.action, 'pf-v6-u-font-weight-bold', 'pf-v6-u-mb-sm')}>
<Icon size="md" className="pf-v6-u-pl-sm pf-v6-u-pr-md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@ The **service card** component displays a card representing a service with an ic

## Examples

### Service Card
### Basic service card

This shows a basic service card with an `icon`, `title`, `description`, and optional footer passed in.
This shows a basic service card with an `icon`, `title`, `description`, and optional footer passed in. You can also pass all props of the [card component](/components/card).

```js file="./ServiceCardExample.tsx"

```

### Service Card in gallery example
### Stacked service card

This shows how cards can look side by side in a [gallery layout](/layouts/gallery).
If you set `isStacked` property to `true`, the header layout changes to stacked.

```js file="./ServiceCardStackedExample.tsx"

```

### Service card in a gallery

This shows how cards can look side by side in a [gallery layout](/layouts/gallery). If you set `isFullHeight` property to `true`, the card height will fill the available space.

```js file="./ServiceCardGalleryExample.tsx"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import contentHeaderIcon from '../../assets/icons/content-header-icon.svg';
export const ServiceCardGalleryExample: React.FunctionComponent = () => (
<Gallery hasGutter minWidths={{ default: '330px' }}>
<GalleryItem>
<ServiceCard
<ServiceCard
isStacked
title='Example1'
subtitle='A basic example'
description='This is a basic ServiceCard example'
Expand All @@ -17,7 +18,8 @@ export const ServiceCardGalleryExample: React.FunctionComponent = () => (
/>
</GalleryItem>
<GalleryItem>
<ServiceCard
<ServiceCard
isStacked
title='Example2'
subtitle='A second example'
description='This is another basic ServiceCard example'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react';
import ServiceCard from "@patternfly/react-component-groups/dist/dynamic/ServiceCard";
import contentHeaderIcon from '../../assets/icons/content-header-icon.svg';
import { Button, ButtonVariant } from '@patternfly/react-core';


export const BasicExample: React.FunctionComponent = () => (
<ServiceCard
isStacked
title='Example'
subtitle='A basic example'
description='This is a basic ServiceCard Example'
icon={<img src={contentHeaderIcon} alt="content-header-icon" />}
helperText='Here is helper text'
footer={<>
<Button
variant={ButtonVariant.secondary}
className='pf-v6-u-mr-md'
component="a"
href='www.patternfly.org'>
Launch
</Button>
<Button
variant={ButtonVariant.link}
component="a"
href='www.patternfly.org'
>
Learn More
</Button></>
}
/>
);
4 changes: 2 additions & 2 deletions packages/module/src/ServiceCard/ServiceCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { render } from '@testing-library/react';
import ServiceCard from './ServiceCard';

describe('LogSnippet component', () => {
it('should render LogSnippet component', () => {
describe('ServiceCard component', () => {
it('should render ServiceCard component', () => {
expect(render(<ServiceCard
title='Example'
subtitle='A basic example'
Expand Down
Loading