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.5.0"
},
"devDependencies": {
"@patternfly/patternfly": "6.0.0-alpha.28",
"@patternfly/patternfly": "6.0.0-alpha.38",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-replace": "^5.0.2",
Expand Down
16 changes: 1 addition & 15 deletions packages/react-core/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export interface AvatarProps
src?: string;
/** Attribute that specifies the alternate text of the image for the Avatar. */
alt: string;
/** Border to add */
border?: 'light' | 'dark';
/** Size variant of avatar. */
size?: 'sm' | 'md' | 'lg' | 'xl';
}
Expand All @@ -20,21 +18,9 @@ export const Avatar: React.FunctionComponent<AvatarProps> = ({
className = '',
src = '',
alt,
border,
size,
...props
}: AvatarProps) => (
<img
src={src}
alt={alt}
className={css(
styles.avatar,
styles.modifiers[size],
border === 'light' && styles.modifiers.light,
border === 'dark' && styles.modifiers.dark,
className
)}
{...props}
/>
<img src={src} alt={alt} className={css(styles.avatar, styles.modifiers[size], className)} {...props} />
);
Avatar.displayName = 'Avatar';
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ test('Renders simple avatar', () => {
expect(screen.getByTestId('avatar').firstChild).toBeVisible();
});

// TODO: Need to be updated as part of issue #9880
test('Renders without any modifier class when border and size props are not passed', () => {
render(<Avatar alt="avatar" />);
expect(screen.getByRole('img')).toHaveClass(styles.avatar, { exact: true });
});

test('Renders with class name pf-m-light when "light" is passed as border prop', () => {
render(<Avatar alt="avatar" border="light" />);
// TODO: Need to be updated/removed as part of issue #9880
xtest('Renders with class name pf-m-light when "light" is passed as border prop', () => {
render(<Avatar alt="avatar" />);
expect(screen.getByRole('img')).toHaveClass('pf-m-light');
});

test('Renders with class name pf-m-dark when "dark" is passed as border prop', () => {
render(<Avatar alt="avatar" border="dark" />);
// TODO: Need to be updated/removed as part of issue #9880
xtest('Renders with class name pf-m-dark when "dark" is passed as border prop', () => {
render(<Avatar alt="avatar" />);
expect(screen.getByRole('img')).toHaveClass('pf-m-dark');
});

Expand Down
6 changes: 4 additions & 2 deletions packages/react-core/src/components/Avatar/examples/Avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ import React from 'react';
import { Avatar } from '@patternfly/react-core';
import avatarImg from '../../assets/avatarImg.svg';

<Avatar src={avatarImg} alt="avatar" border="light" />;
// TODO: Need to be updated/removed as part of issue #9880
<Avatar src={avatarImg} alt="avatar" />;
```

### Bordered - dark
Expand All @@ -64,5 +65,6 @@ import React from 'react';
import { Avatar } from '@patternfly/react-core';
import avatarImgDark from '../../assets/avatarImgDark.svg';

<Avatar src={avatarImgDark} alt="avatar" border="dark" />;
// TODO: Need to be updated/removed as part of issue #9880
<Avatar src={avatarImgDark} alt="avatar" />;
```
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export interface ExpandableSectionProps extends React.HTMLProps<HTMLDivElement>
toggleId?: string;
/** Display size variant. Set to "lg" for disclosure styling. */
displaySize?: 'default' | 'lg';
/** Forces active state. */
isActive?: boolean;
/** Indicates the expandable section has a detached toggle. */
isDetached?: boolean;
/** Flag to indicate if the content is expanded. */
Expand Down Expand Up @@ -103,7 +101,6 @@ class ExpandableSection extends React.Component<ExpandableSectionProps, Expandab
toggleTextCollapsed: '',
// eslint-disable-next-line @typescript-eslint/no-unused-vars
onToggle: (event, isExpanded): void => undefined,
isActive: false,
isDetached: false,
displaySize: 'default',
isWidthLimited: false,
Expand Down Expand Up @@ -182,8 +179,6 @@ class ExpandableSection extends React.Component<ExpandableSectionProps, Expandab
render() {
const {
onToggle: onToggleProp,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
isActive,
className,
toggleText,
toggleTextExpanded,
Expand Down Expand Up @@ -253,7 +248,6 @@ class ExpandableSection extends React.Component<ExpandableSectionProps, Expandab
className={css(
styles.expandableSection,
propOrStateIsExpanded && styles.modifiers.expanded,
isActive && styles.modifiers.active,
displaySize === 'lg' && styles.modifiers.displayLg,
isWidthLimited && styles.modifiers.limitWidth,
isIndented && styles.modifiers.indented,
Expand Down
5 changes: 2 additions & 3 deletions packages/react-core/src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export interface PaginationProps extends React.HTMLProps<HTMLDivElement>, OUIAPr
xl?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';
'2xl'?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';
};
/** Flag indicating if pagination is compact. */
isCompact?: boolean;
/** Flag indicating if pagination is disabled. */
isDisabled?: boolean;
/** Flag indicating if pagination is compact. */
isCompact?: boolean;
/** Flag indicating if pagination should not be sticky on mobile. */
isStatic?: boolean;
/** Flag indicating if pagination should stick to its position (based on variant). */
Expand Down Expand Up @@ -285,7 +285,6 @@ export const Pagination: React.FunctionComponent<PaginationProps> = ({
variant === PaginationVariant.bottom && styles.modifiers.bottom,
usePageInsets && styles.modifiers.pageInsets,
formatBreakpointMods(inset, styles),
isCompact && styles.modifiers.compact,
isStatic && styles.modifiers.static,
isSticky && styles.modifiers.sticky,
className
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Pagination', () => {
});

test('should render correctly compact', () => {
const { asFragment } = render(<Pagination itemCount={20} isCompact />);
const { asFragment } = render(<Pagination itemCount={20} />);
expect(asFragment()).toMatchSnapshot();
});

Expand Down
Loading