Skip to content
Open
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,8 +7,8 @@ propComponents: ['ActionList', 'ActionListGroup', 'ActionListItem']

import { Fragment, useState } from 'react';
import RhMicronsCloseIcon from '@patternfly/react-icons/dist/js/icons/rh-microns-close-icon';
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
import RhUiEllipsisVerticalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-vertical-fill-icon';
import RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/js/icons/rh-microns-checkmark-icon';

## Examples

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ActionList, ActionListGroup, ActionListItem, Button } from '@patternfly/react-core';
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
import RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-icon';
import RhMicronsCloseIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-close-icon';

export const ActionListVertical: React.FunctionComponent = () => (
Expand Down Expand Up @@ -30,15 +30,23 @@ export const ActionListVertical: React.FunctionComponent = () => (
<Button aria-label="Close vertical action list group 1" variant="plain" icon={<RhMicronsCloseIcon />} />
</ActionListItem>
<ActionListItem>
<Button aria-label="Toggle vertical action list example group 1" variant="plain" icon={<CheckIcon />} />
<Button
aria-label="Toggle vertical action list example group 1"
variant="plain"
icon={<RhMicronsCheckmarkIcon />}
/>
</ActionListItem>
</ActionListGroup>
<ActionListGroup>
<ActionListItem>
<Button aria-label="Close vertical action list group 2" variant="plain" icon={<RhMicronsCloseIcon />} />
</ActionListItem>
<ActionListItem>
<Button aria-label="Toggle vertical action list example group 2" variant="plain" icon={<CheckIcon />} />
<Button
aria-label="Toggle vertical action list example group 2"
variant="plain"
icon={<RhMicronsCheckmarkIcon />}
/>
</ActionListItem>
</ActionListGroup>
</ActionList>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ActionList, ActionListGroup, ActionListItem, Button } from '@patternfly/react-core';
import RhMicronsCloseIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-close-icon';
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
import RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-icon';

export const ActionListWithIcons: React.FunctionComponent = () => (
<>
Expand All @@ -15,7 +15,12 @@ export const ActionListWithIcons: React.FunctionComponent = () => (
/>
</ActionListItem>
<ActionListItem>
<Button variant="plain" id="with-icons-check-button" aria-label="check icon button" icon={<CheckIcon />} />
<Button
variant="plain"
id="with-icons-check-button"
aria-label="check icon button"
icon={<RhMicronsCheckmarkIcon />}
/>
</ActionListItem>
</ActionList>
<br />
Expand All @@ -35,7 +40,7 @@ export const ActionListWithIcons: React.FunctionComponent = () => (
variant="plain"
id="with-icons-list-check-button"
aria-label="check icon button"
icon={<CheckIcon />}
icon={<RhMicronsCheckmarkIcon />}
/>
</ActionListItem>
</ActionListGroup>
Expand All @@ -53,7 +58,7 @@ export const ActionListWithIcons: React.FunctionComponent = () => (
variant="plain"
id="with-icons-group-check-button"
aria-label="check icon button"
icon={<CheckIcon />}
icon={<RhMicronsCheckmarkIcon />}
/>
</ActionListItem>
</ActionListGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ propComponents: ['HelperText', 'HelperTextItem']
import { Fragment } from 'react';
import InfoIcon from '@patternfly/react-icons/dist/esm/icons/info-icon';
import QuestionIcon from '@patternfly/react-icons/dist/esm/icons/question-icon';
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
import RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-icon';
import RhMicronsCloseIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-close-icon';
import ExclamationIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-icon';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { HelperText, HelperTextItem } from '@patternfly/react-core';
import InfoIcon from '@patternfly/react-icons/dist/esm/icons/info-icon';
import QuestionIcon from '@patternfly/react-icons/dist/esm/icons/question-icon';
import ExclamationIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-icon';
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
import RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-icon';
import RhMicronsCloseIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-close-icon';

export const HelperTextWithCustomIcon: React.FunctionComponent = () => (
Expand All @@ -22,7 +22,7 @@ export const HelperTextWithCustomIcon: React.FunctionComponent = () => (
</HelperTextItem>
</HelperText>
<HelperText>
<HelperTextItem variant="success" icon={<CheckIcon />}>
<HelperTextItem variant="success" icon={<RhMicronsCheckmarkIcon />}>
This is success helper text
</HelperTextItem>
</HelperText>
Expand Down
38 changes: 19 additions & 19 deletions packages/react-core/src/components/Icon/__tests__/Icon.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { render, screen } from '@testing-library/react';
import { kebabCase } from 'case-anything';
import { Icon, IconSize } from '../Icon';
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
import RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-icon';
import styles from '@patternfly/react-styles/css/components/Icon/icon';

test('renders basic icon successfully', () => {
const { asFragment } = render(
<Icon>
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
expect(asFragment()).toMatchSnapshot();
Expand All @@ -16,7 +16,7 @@ test('renders basic icon successfully', () => {
test('checks basic icon structure', () => {
render(
<Icon title="icon">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('icon');
Expand All @@ -33,7 +33,7 @@ test('renders without children', () => {
test('sets additional custom class successfully', () => {
render(
<Icon className="test" title="custom-icon">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('custom-icon');
Expand Down Expand Up @@ -61,7 +61,7 @@ Object.values([
test(`sets icon size modifier successfully - ${size}`, () => {
render(
<Icon iconSize={size as IconSize} title={`content-${size}-icon`}>
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle(`content-${size}-icon`).querySelector(`.${styles.iconContent}`);
Expand All @@ -74,7 +74,7 @@ Object.values([
test(`sets progress icon size modifier successfully - ${size}`, () => {
render(
<Icon isInProgress progressIconSize={size as IconSize} title={`progress-content-${size}-icon`}>
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle(`progress-content-${size}-icon`).querySelector(`.${styles.iconProgress}`);
Expand All @@ -87,7 +87,7 @@ Object.values([
test(`sets size modifier successfully - ${size}`, () => {
render(
<Icon size={size as IconSize} title={`${size}-icon`}>
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle(`${size}-icon`);
Expand All @@ -101,7 +101,7 @@ Object.values([
test('check icon without iconSize', () => {
render(
<Icon title="no-icon-size">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('no-icon-size').querySelector(`.${styles.iconContent}`);
Expand All @@ -111,7 +111,7 @@ test('check icon without iconSize', () => {
test('check icon without progress icon size', () => {
render(
<Icon title="no-progress-icon-size">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('no-progress-icon-size').querySelector(`.${styles.iconProgress}`);
Expand All @@ -121,7 +121,7 @@ test('check icon without progress icon size', () => {
test('check icon without size', () => {
render(
<Icon title="no-size">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('no-size');
Expand All @@ -132,7 +132,7 @@ Object.values(['custom', 'info', 'success', 'warning', 'danger']).forEach((statu
test(`sets status modifier successfully - ${status}`, () => {
render(
<Icon status={status as 'custom' | 'info' | 'success' | 'warning' | 'danger'} title={`${status}-icon`}>
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContent = screen.getByTitle(`${status}-icon`).querySelector(`.${styles.iconContent}`);
Expand All @@ -144,7 +144,7 @@ Object.values(['custom', 'info', 'success', 'warning', 'danger']).forEach((statu
test('check icon without status', () => {
render(
<Icon title="no-status">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContent = screen.getByTitle('no-status').querySelector(`.${styles.iconContent}`);
Expand All @@ -154,7 +154,7 @@ test('check icon without status', () => {
test('sets isInline successfully', () => {
render(
<Icon isInline title="inline-icon">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('inline-icon');
Expand All @@ -165,7 +165,7 @@ test('sets isInline successfully', () => {
test('check icon without isInline', () => {
render(
<Icon title="no-inline">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('no-inline');
Expand All @@ -175,7 +175,7 @@ test('check icon without isInline', () => {
test('sets isInProgress successfully', () => {
render(
<Icon isInProgress title="progress-icon">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('progress-icon');
Expand All @@ -188,7 +188,7 @@ test('sets isInProgress successfully', () => {
test('check icon without isInProgress', () => {
render(
<Icon title="no-in-progress">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);
const iconContainer = screen.getByTitle('no-in-progress');
Expand All @@ -198,7 +198,7 @@ test('check icon without isInProgress', () => {
test('sets default progres aria-label successfully', () => {
render(
<Icon isInProgress defaultProgressArialabel="test" title="progress-icon">
<CheckIcon />
<RhMicronsCheckmarkIcon />
</Icon>
);

Expand All @@ -207,8 +207,8 @@ test('sets default progres aria-label successfully', () => {

test('renders progress icon successfully', () => {
const { asFragment } = render(
<Icon isInProgress progressIcon={<CheckIcon />}>
<CheckIcon />
<Icon isInProgress progressIcon={<RhMicronsCheckmarkIcon />}>
<RhMicronsCheckmarkIcon />
</Icon>
);
expect(asFragment()).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,12 @@ exports[`renders basic icon successfully 1`] = `
fill="currentColor"
height="1em"
role="img"
viewBox="0 0 20 20"
width="1em"
>
<svg
class="pf-v6-icon-default"
viewBox="0 0 512 512"
>
<path
d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"
/>
</svg>
<svg
class="pf-v6-icon-rh-ui"
viewBox="0 0 32 32"
>
<path
d="M11 26.792c-.384 0-.769-.146-1.061-.438l-8.646-8.647a.999.999 0 1 1 1.414-1.414L11 24.586 29.293 6.293a.999.999 0 1 1 1.414 1.414L12.061 26.354a1.497 1.497 0 0 1-1.061.438Z"
/>
</svg>
<path
d="M18.71 4.27c-.4-.38-1.03-.37-1.41.02L7 14.59 2.71 10.3l-.02-.02c-.4-.38-1.03-.37-1.41.02-.38.4-.37 1.03.02 1.41l4.65 4.65a1.499 1.499 0 0 0 2.12 0L18.72 5.71l.02-.02c.38-.4.37-1.03-.02-1.41Z"
/>
</svg>
</span>
</span>
Expand All @@ -52,24 +40,12 @@ exports[`renders progress icon successfully 1`] = `
fill="currentColor"
height="1em"
role="img"
viewBox="0 0 20 20"
width="1em"
>
<svg
class="pf-v6-icon-default"
viewBox="0 0 512 512"
>
<path
d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"
/>
</svg>
<svg
class="pf-v6-icon-rh-ui"
viewBox="0 0 32 32"
>
<path
d="M11 26.792c-.384 0-.769-.146-1.061-.438l-8.646-8.647a.999.999 0 1 1 1.414-1.414L11 24.586 29.293 6.293a.999.999 0 1 1 1.414 1.414L12.061 26.354a1.497 1.497 0 0 1-1.061.438Z"
/>
</svg>
<path
d="M18.71 4.27c-.4-.38-1.03-.37-1.41.02L7 14.59 2.71 10.3l-.02-.02c-.4-.38-1.03-.37-1.41.02-.38.4-.37 1.03.02 1.41l4.65 4.65a1.499 1.499 0 0 0 2.12 0L18.72 5.71l.02-.02c.38-.4.37-1.03-.02-1.41Z"
/>
</svg>
</span>
<span
Expand All @@ -81,24 +57,12 @@ exports[`renders progress icon successfully 1`] = `
fill="currentColor"
height="1em"
role="img"
viewBox="0 0 20 20"
width="1em"
>
<svg
class="pf-v6-icon-default"
viewBox="0 0 512 512"
>
<path
d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"
/>
</svg>
<svg
class="pf-v6-icon-rh-ui"
viewBox="0 0 32 32"
>
<path
d="M11 26.792c-.384 0-.769-.146-1.061-.438l-8.646-8.647a.999.999 0 1 1 1.414-1.414L11 24.586 29.293 6.293a.999.999 0 1 1 1.414 1.414L12.061 26.354a1.497 1.497 0 0 1-1.061.438Z"
/>
</svg>
<path
d="M18.71 4.27c-.4-.38-1.03-.37-1.41.02L7 14.59 2.71 10.3l-.02-.02c-.4-.38-1.03-.37-1.41.02-.38.4-.37 1.03.02 1.41l4.65 4.65a1.499 1.499 0 0 0 2.12 0L18.72 5.71l.02-.02c.38-.4.37-1.03-.02-1.41Z"
/>
</svg>
</span>
</span>
Expand Down
4 changes: 2 additions & 2 deletions packages/react-core/src/components/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import leftOffset from '@patternfly/react-tokens/dist/esm/c_menu_m_flyout__menu_
import RhMicronsExternalLinkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-external-link-icon';
import RhMicronsCaretLeftIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-left-icon';
import RhMicronsCaretRightIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-right-icon';
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
import RhMicronsCheckmarkIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-checkmark-icon';
import { Checkbox } from '../Checkbox';
import { MenuContext, MenuItemContext } from './MenuContext';
import { MenuItemAction } from './MenuItemAction';
Expand Down Expand Up @@ -399,7 +399,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
)}
{getIsSelected() && (
<span className={css(styles.menuItemSelectIcon)}>
<CheckIcon />
<RhMicronsCheckmarkIcon />
</span>
)}
</span>
Expand Down
Loading
Loading