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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@rollup/plugin-terser": "^0.4.4",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "29.5.14",
"@types/node": "^22.16.5",
Expand All @@ -54,7 +54,7 @@
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-compiler": "19.0.0-beta-ebf51a3-20250411",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-testing-library": "^7.1.1",
"eslint-plugin-testing-library": "^7.15.4",
"fs-extra": "^11.3.3",
"glob": "^11.1.0",
"globals": "^15.15.0",
Expand All @@ -66,12 +66,12 @@
"lint-staged": "^15.5.2",
"mutation-observer": "^1.0.3",
"plop": "^4.0.4",
"prettier": "^3.5.3",
"prettier": "^3.8.1",
"publint": "^0.3.16",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rimraf": "^6.0.1",
"rollup": "^4.36.0",
"rimraf": "^6.1.2",
"rollup": "^4.57.1",
"rollup-plugin-scss": "^4.0.1",
"rollup-plugin-svg": "^2.0.0",
"sass": "^1.86.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import styles from '@patternfly/react-styles/css/components/Accordion/accordion'
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
import { AccordionContext, AccordionItemContext } from './AccordionContext';

export interface AccordionToggleProps
extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
export interface AccordionToggleProps extends React.DetailedHTMLProps<
React.ButtonHTMLAttributes<HTMLButtonElement>,
HTMLButtonElement
> {
/** Content rendered inside the Accordion toggle */
children?: React.ReactNode;
/** Additional classes added to the Accordion Toggle */
Expand Down
6 changes: 4 additions & 2 deletions packages/react-core/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import styles from '@patternfly/react-styles/css/components/Avatar/avatar';
import { css } from '@patternfly/react-styles';

export interface AvatarProps
extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
export interface AvatarProps extends React.DetailedHTMLProps<
React.ImgHTMLAttributes<HTMLImageElement>,
HTMLImageElement
> {
/** Additional classes added to the avatar. */
className?: string;
/** Attribute that specifies the URL of the image for the avatar. */
Expand Down
6 changes: 4 additions & 2 deletions packages/react-core/src/components/Brand/Brand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import { setBreakpointCssVars } from '../../helpers';
import cssBrandHeight from '@patternfly/react-tokens/dist/esm/c_brand_Height';
import cssBrandWidth from '@patternfly/react-tokens/dist/esm/c_brand_Width';

export interface BrandProps
extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
export interface BrandProps extends React.DetailedHTMLProps<
React.ImgHTMLAttributes<HTMLImageElement>,
HTMLImageElement
> {
/** Transforms the Brand into a <picture> element from an <img> element. Container for <source> child elements. */
children?: React.ReactNode;
/** Additional classes added to the either type of Brand. */
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { getUniqueId } from '../../helpers/util';
import { ASTERISK } from '../../helpers/htmlConstants';

export interface CheckboxProps
extends Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'label'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'label'>, OUIAProps {
/** Additional classes added to the checkbox wrapper. This wrapper will be div element by default. It will be a label element if
* isLabelWrapped is true, or it can be overridden by any element specified in the component prop.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
import { Button } from '../Button';
import { Tooltip, TooltipPosition } from '../Tooltip';

export interface ClipboardCopyButtonProps
extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'ref'> {
export interface ClipboardCopyButtonProps extends Omit<
React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>,
'ref'
> {
/** Callback for the copy when the button is clicked */
onClick: (event: React.MouseEvent) => void;
/** Content of the copy button */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { css } from '@patternfly/react-styles';
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
import { Button } from '../Button';

export interface ClipboardCopyToggleProps
extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'ref'> {
export interface ClipboardCopyToggleProps extends Omit<
React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>,
'ref'
> {
onClick: (event: React.MouseEvent) => void;
id: string;
contentId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test('Renders with default tooltip content', async () => {

const button = screen.getByRole('button');

user.hover(button);
await user.hover(button);

await screen.findByRole('tooltip');

Expand All @@ -36,7 +36,7 @@ test('Renders with custom tooltip content when provided', async () => {

const button = screen.getByRole('button');

user.hover(button);
await user.hover(button);

await screen.findByRole('tooltip');
expect(screen.getByRole('tooltip')).toHaveTextContent('Custom tooltip');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('Renders with default tooltip content', async () => {

const button = screen.getByRole('button');

user.hover(button);
await user.hover(button);

await screen.findByRole('tooltip');

Expand All @@ -34,7 +34,7 @@ test('Renders with custom tooltip content when provided', async () => {

const button = screen.getByRole('button');

user.hover(button);
await user.hover(button);

await screen.findByRole('tooltip');

Expand Down
3 changes: 2 additions & 1 deletion packages/react-core/src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
/** The main date picker component. */

export interface DatePickerProps
extends CalendarFormat,
extends
CalendarFormat,
Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'ref'> {
/** The container to append the menu to. Defaults to 'inline'.
* If your menu is being cut off you can append it to an element higher up the DOM tree.
Expand Down Expand Up @@ -130,7 +131,7 @@
const [selectOpen, setSelectOpen] = useState(false);
const [pristine, setPristine] = useState(true);
const [textInputFocused, setTextInputFocused] = useState(false);
const widthChars = useMemo(() => Math.max(dateFormat(new Date()).length, placeholder.length), [dateFormat]);

Check warning on line 134 in packages/react-core/src/components/DatePicker/DatePicker.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useMemo has a missing dependency: 'placeholder.length'. Either include it or remove the dependency array
const style = { [cssFormControlWidthChars.name]: widthChars, ...styleProps };
const buttonRef = useRef<HTMLButtonElement>(undefined);
const datePickerWrapperRef = useRef<HTMLDivElement>(undefined);
Expand All @@ -141,7 +142,7 @@
useEffect(() => {
setValue(valueProp);
setValueDate(dateParse(valueProp));
}, [valueProp]);

Check warning on line 145 in packages/react-core/src/components/DatePicker/DatePicker.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'dateParse'. Either include it or remove the dependency array. If 'dateParse' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
if (isValidDate(valueDate)) {
Expand Down
9 changes: 4 additions & 5 deletions packages/react-core/src/components/FileUpload/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import { readFile, fileReaderType } from '../../helpers/fileUtils';
import { DropEvent } from '../../helpers/typeUtils';
import { fromEvent } from 'file-selector';

export interface FileUploadProps
extends Omit<
FileUploadFieldProps,
'children' | 'onBrowseButtonClick' | 'onClearButtonClick' | 'isDragActive' | 'containerRef'
> {
export interface FileUploadProps extends Omit<
FileUploadFieldProps,
'children' | 'onBrowseButtonClick' | 'onClearButtonClick' | 'isDragActive' | 'containerRef'
> {
/** Flag to allow editing of a text file's contents after it is selected from disk. */
allowEditingUploadedText?: boolean;
/** Aria-label for the text area. */
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/FormSelect/FormSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';

export interface FormSelectProps
extends Omit<React.HTMLProps<HTMLSelectElement>, 'onChange' | 'onBlur' | 'onFocus' | 'disabled'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLSelectElement>, 'onChange' | 'onBlur' | 'onFocus' | 'disabled'>, OUIAProps {
/** content rendered inside the FormSelect */
children: React.ReactNode;
/** additional classes added to the FormSelect control */
Expand Down
6 changes: 4 additions & 2 deletions packages/react-core/src/components/Masthead/MastheadLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import styles from '@patternfly/react-styles/css/components/Masthead/masthead';
import { css } from '@patternfly/react-styles';

export interface MastheadLogoProps
extends React.DetailedHTMLProps<React.HTMLProps<HTMLAnchorElement>, HTMLAnchorElement> {
export interface MastheadLogoProps extends React.DetailedHTMLProps<
React.HTMLProps<HTMLAnchorElement>,
HTMLAnchorElement
> {
/** Content rendered inside of the masthead logo. */
children?: React.ReactNode;
/** Additional classes added to the masthead logo. */
Expand Down
3 changes: 2 additions & 1 deletion packages/react-core/src/components/MenuToggle/MenuToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export enum MenuToggleSize {
export type MenuToggleElement = HTMLDivElement | HTMLButtonElement;

export interface MenuToggleProps
extends Omit<
extends
Omit<
React.DetailedHTMLProps<
React.ButtonHTMLAttributes<HTMLButtonElement> & React.HTMLAttributes<HTMLDivElement>,
MenuToggleElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { PickOptional } from '../../helpers/typeUtils';
import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';

export interface MenuToggleCheckboxProps
extends Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'checked'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'checked'>, OUIAProps {
/** Additional classes added to the MenuToggleCheckbox */
className?: string;
/** Flag to show if the checkbox selection is valid or invalid */
Expand Down
3 changes: 2 additions & 1 deletion packages/react-core/src/components/Nav/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export type NavSelectClickHandler = (
to: string
) => void;
export interface NavProps
extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, 'onSelect' | 'onToggle'>,
extends
Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, 'onSelect' | 'onToggle'>,
OUIAProps {
/** Anything that can be rendered inside of the nav */
children?: React.ReactNode;
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/Nav/NavExpandable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { PickOptional } from '../../helpers/typeUtils';
import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';

export interface NavExpandableProps
extends Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, 'title'>,
OUIAProps {
extends Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, 'title'>, OUIAProps {
/** Title content shown for the expandable list */
title: React.ReactNode;
/** If defined, screen readers will read this text instead of the list title */
Expand Down
6 changes: 4 additions & 2 deletions packages/react-core/src/components/Nav/NavList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import { NavContext } from './Nav';
import { PageSidebarContext } from '../Page/PageSidebar';
import { getResizeObserver } from '../../helpers/resizeObserver';

export interface NavListProps
extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {
export interface NavListProps extends React.DetailedHTMLProps<
React.HTMLAttributes<HTMLUListElement>,
HTMLUListElement
> {
/** Children nodes */
children?: React.ReactNode;
/** Additional classes added to the list */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export enum ProgressStepVariant {
warning = 'warning'
}

export interface ProgressStepProps
extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
export interface ProgressStepProps extends React.DetailedHTMLProps<
React.LiHTMLAttributes<HTMLLIElement>,
HTMLLIElement
> {
/** Content rendered inside the progress step. */
children?: React.ReactNode;
/** Additional classes applied to the progress step container. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import styles from '@patternfly/react-styles/css/components/ProgressStepper/progress-stepper';
import { css } from '@patternfly/react-styles';

export interface ProgressStepperProps
extends React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement> {
export interface ProgressStepperProps extends React.DetailedHTMLProps<
React.OlHTMLAttributes<HTMLOListElement>,
HTMLOListElement
> {
/** Content rendered inside the progress stepper. */
children?: React.ReactNode;
/** Additional classes applied to the progress stepper container. */
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/Radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';
import { getUniqueId } from '../../helpers/util';

export interface RadioProps
extends Omit<React.HTMLProps<HTMLInputElement>, 'disabled' | 'label' | 'onChange' | 'type'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLInputElement>, 'disabled' | 'label' | 'onChange' | 'type'>, OUIAProps {
/** Additional classes added to the radio wrapper. This wrapper will be div element by default. It will be a label element if
* isLabelWrapped is true, or it can be overridden by any element specified in the component prop.
*/
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { getUniqueId } from '../../helpers/util';
import { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';

export interface SwitchProps
extends Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'label'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'label'>, OUIAProps {
/** id for the label. */
id?: string;
/** Additional classes added to the switch */
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/Tabs/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
import { TabAction } from './TabAction';

export interface TabProps
extends Omit<React.HTMLProps<HTMLAnchorElement | HTMLButtonElement>, 'title' | 'action'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLAnchorElement | HTMLButtonElement>, 'title' | 'action'>, OUIAProps {
/** content rendered inside the Tab content area. */
children?: React.ReactNode;
/** additional classes added to the Tab */
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ type TabElement = React.ReactElement<TabProps, React.JSXElementConstructor<TabPr
type TabsChild = TabElement | boolean | null | undefined;

export interface TabsProps
extends Omit<React.HTMLProps<HTMLElement | HTMLDivElement>, 'onSelect' | 'onToggle'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLElement | HTMLDivElement>, 'onSelect' | 'onToggle'>, OUIAProps {
/** Content rendered inside the tabs component. Only `Tab` components or expressions resulting in a falsy value are allowed here. */
children: TabsChild | TabsChild[];
/** Additional classes added to the tabs */
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export interface TextInputExpandedObj {
}

export interface TextInputProps
extends Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'ref'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'ref'>, OUIAProps {
/** Additional classes added to the text input. */
className?: string;
/** Flag to show if the text input is disabled. */
Expand Down
6 changes: 4 additions & 2 deletions packages/react-core/src/components/TimePicker/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ import { HelperText, HelperTextItem } from '../HelperText';
import OutlinedClockIcon from '@patternfly/react-icons/dist/esm/icons/outlined-clock-icon';
import cssDatePickerFormControlWidth from '@patternfly/react-tokens/dist/esm/c_date_picker__input_c_form_control_Width';

export interface TimePickerProps
extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'ref'> {
export interface TimePickerProps extends Omit<
React.HTMLProps<HTMLDivElement>,
'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'ref'
> {
/** Additional classes added to the time picker. */
className?: string;
/** Accessible label for the time picker */
Expand Down
3 changes: 1 addition & 2 deletions packages/react-core/src/components/Wizard/WizardNavItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { OUIAProps, useOUIAProps } from '../../helpers';
import { WizardNavItemStatus } from './types';

export interface WizardNavItemProps
extends Omit<React.HTMLProps<HTMLLIElement>, 'onClick' | 'id' | 'content' | 'type'>,
OUIAProps {
extends Omit<React.HTMLProps<HTMLLIElement>, 'onClick' | 'id' | 'content' | 'type'>, OUIAProps {
/** Additional classes spread to the wizard nav item */
className?: string;
/** Can nest a WizardNav component for substeps */
Expand Down
2 changes: 1 addition & 1 deletion packages/react-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"victory": "^37.3.6"
},
"devDependencies": {
"@patternfly/documentation-framework": "^6.28.9",
"@patternfly/documentation-framework": "^6.33.9",
"@patternfly/patternfly-a11y": "5.1.0"
},
"keywords": [
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 @@ -44,4 +44,4 @@
"react": "^17 || ^18 || ^19",
"react-dom": "^17 || ^18 || ^19"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import inlineStyles from '@patternfly/react-styles/css/components/InlineEdit/inl
import formStyles from '@patternfly/react-styles/css/components/Form/form';
import { EditableSelectInputProps } from './base/types';

export interface IEditableSelectInputCell
extends Omit<React.HTMLProps<HTMLElement | HTMLDivElement>, 'onSelect' | 'onToggle'> {
export interface IEditableSelectInputCell extends Omit<
React.HTMLProps<HTMLElement | HTMLDivElement>,
'onSelect' | 'onToggle'
> {
/** Row index of this select input cell */
rowIndex: number;
/** Cell index of this select input cell */
Expand Down
3 changes: 1 addition & 2 deletions packages/react-table/src/components/Table/Th.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import cssStickyCellInlineStart from '@patternfly/react-tokens/dist/esm/c_table_
import cssStickyCellInlineEnd from '@patternfly/react-tokens/dist/esm/c_table__sticky_cell_InsetInlineEnd';

export interface ThProps
extends BaseCellProps,
Omit<React.HTMLProps<HTMLTableHeaderCellElement>, 'onSelect' | 'width'> {
extends BaseCellProps, Omit<React.HTMLProps<HTMLTableHeaderCellElement>, 'onSelect' | 'width'> {
/**
* The column header the cell corresponds to. Applicable when this component is used as a direct child to <Tr>.
* This attribute replaces table header in mobile viewport. It is rendered by ::before pseudo element.
Expand Down
Loading
Loading