diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index 663f5774573..00000000000 --- a/.github/renovate.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended" - ], - "rangeStrategy": "bump", - "packageRules": [ - { - "matchUpdateTypes": [ - "major" - ], - "enabled": false - } - ] -} diff --git a/package.json b/package.json index 60e5c473760..bbbd8fe68c2 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "engines": { "node": ">=20.17.0" }, - "packageManager": "yarn@4.3.1", + "packageManager": "yarn@4.5.0", "keywords": [ "react", "patternfly", @@ -29,10 +29,10 @@ "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "@eslint/compat": "^1.1.1", - "@eslint/js": "^9.10.0", + "@eslint/js": "^9.11.1", "@octokit/rest": "^20.1.1", - "@rollup/plugin-commonjs": "^26.0.1", - "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-commonjs": "^26.0.3", + "@rollup/plugin-node-resolve": "^15.3.0", "@rollup/plugin-replace": "^5.0.7", "@rollup/plugin-terser": "^0.4.4", "@testing-library/dom": "^10.4.0", @@ -40,15 +40,15 @@ "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.2", "@types/jest": "29.5.13", - "@types/node": "^20.16.5", - "@types/react": "^18.3.6", + "@types/node": "^20.16.9", + "@types/react": "^18.3.8", "@types/react-dom": "^18.3.0", "babel-jest": "^29.7.0", "concurrently": "^8.2.2", - "eslint": "^9.10.0", + "eslint": "^9.11.1", "eslint-plugin-markdown": "^5.1.0", - "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-react": "^7.34.4", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react": "^7.37.1", "eslint-plugin-testing-library": "^6.3.0", "fs-extra": "^11.2.0", "glob": "^10.4.5", @@ -65,10 +65,10 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "rimraf": "^5.0.10", - "rollup": "^4.21.3", + "rollup": "^4.24.0", "rollup-plugin-scss": "^4.0.0", "rollup-plugin-svg": "^2.0.0", - "sass": "^1.78.0", + "sass": "^1.79.3", "surge": "^0.24.6", "ts-node": "^10.9.2", "ts-patch": "^3.2.1", diff --git a/packages/eslint-plugin-patternfly-react/CHANGELOG.md b/packages/eslint-plugin-patternfly-react/CHANGELOG.md index 249afe8c330..7a7572b0a19 100644 --- a/packages/eslint-plugin-patternfly-react/CHANGELOG.md +++ b/packages/eslint-plugin-patternfly-react/CHANGELOG.md @@ -3,6 +3,26 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.4.3](https://github.com/patternfly/patternfly-react/compare/eslint-plugin-patternfly-react@5.4.2...eslint-plugin-patternfly-react@5.4.3) (2024-10-08) + +### Bug Fixes + +- **deps:** update dependency eslint-plugin-prettier to ^5.2.1 ([#11076](https://github.com/patternfly/patternfly-react/issues/11076)) ([c5259ba](https://github.com/patternfly/patternfly-react/commit/c5259ba034aa51470bb9bc3e7bf945a2577ad392)) + +## [5.4.2](https://github.com/patternfly/patternfly-react/compare/eslint-plugin-patternfly-react@5.4.1...eslint-plugin-patternfly-react@5.4.2) (2024-10-08) + +### Bug Fixes + +- **deps:** update dependency eslint-plugin-react to ^7.37.1 ([#11080](https://github.com/patternfly/patternfly-react/issues/11080)) ([ba052d7](https://github.com/patternfly/patternfly-react/commit/ba052d7a5b35b6593308d25fe4c13074c0423244)) + +## [5.4.1](https://github.com/patternfly/patternfly-react/compare/eslint-plugin-patternfly-react@5.4.0...eslint-plugin-patternfly-react@5.4.1) (2024-09-26) + +### Bug Fixes + +- **deps:** update dependency eslint-plugin-import to ^2.30.0 ([#11074](https://github.com/patternfly/patternfly-react/issues/11074)) ([b8a42a7](https://github.com/patternfly/patternfly-react/commit/b8a42a7a9b14e36f69e1c6993e2dc08bc280c7f1)) +- **deps:** update dependency eslint-plugin-jsx-a11y to ^6.10.0 ([#11075](https://github.com/patternfly/patternfly-react/issues/11075)) ([2d84212](https://github.com/patternfly/patternfly-react/commit/2d84212b9a6d926b66077c70debf0eebc4d5aebb)) +- **deps:** update dependency eslint-plugin-promise to ^6.6.0 ([#11078](https://github.com/patternfly/patternfly-react/issues/11078)) ([abdab91](https://github.com/patternfly/patternfly-react/commit/abdab91e16eebd2f1f19081410386546c1edb226)) + # 5.4.0 (2024-08-27) **Note:** Version bump only for package eslint-plugin-patternfly-react diff --git a/packages/eslint-plugin-patternfly-react/package.json b/packages/eslint-plugin-patternfly-react/package.json index db255c5ec94..01811a2cafb 100644 --- a/packages/eslint-plugin-patternfly-react/package.json +++ b/packages/eslint-plugin-patternfly-react/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-patternfly-react", - "version": "5.4.0", + "version": "5.4.3", "main": "./lib/index.js", "license": "MIT", "publishConfig": { @@ -27,12 +27,12 @@ "eslint-config-standard": "^17.1.0", "eslint-config-standard-jsx": "^11.0.0", "eslint-config-standard-react": "^13.0.0", - "eslint-plugin-import": "^2.29.1", + "eslint-plugin-import": "^2.30.0", "eslint-plugin-jest": "^27.9.0", - "eslint-plugin-jsx-a11y": "^6.9.0", - "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-promise": "^6.4.0", - "eslint-plugin-react": "^7.34.4", + "eslint-plugin-jsx-a11y": "^6.10.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-promise": "^6.6.0", + "eslint-plugin-react": "^7.37.1", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-rulesdir": "^0.2.2", "eslint-plugin-standard": "^4.1.0" diff --git a/packages/react-charts/CHANGELOG.md b/packages/react-charts/CHANGELOG.md index 3352a0fbaf4..f2b4c03e3d9 100644 --- a/packages/react-charts/CHANGELOG.md +++ b/packages/react-charts/CHANGELOG.md @@ -3,6 +3,26 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [7.4.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@7.4.4...@patternfly/react-charts@7.4.5) (2024-10-17) + +**Note:** Version bump only for package @patternfly/react-charts + +## [7.4.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@7.4.3...@patternfly/react-charts@7.4.4) (2024-10-07) + +### Bug Fixes + +- **deps:** update dependency tslib to ^2.7.0 ([#11082](https://github.com/patternfly/patternfly-react/issues/11082)) ([7dfd76f](https://github.com/patternfly/patternfly-react/commit/7dfd76f01ec8fefae2537f406cd658edcd25cc91)) + +## [7.4.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@7.4.2...@patternfly/react-charts@7.4.3) (2024-09-26) + +**Note:** Version bump only for package @patternfly/react-charts + +## [7.4.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@7.4.1...@patternfly/react-charts@7.4.2) (2024-09-19) + +### Bug Fixes + +- **charts:** defaultProps deprecation warning ([#11019](https://github.com/patternfly/patternfly-react/issues/11019)) ([#11028](https://github.com/patternfly/patternfly-react/issues/11028)) ([9b9a7ba](https://github.com/patternfly/patternfly-react/commit/9b9a7ba16aeb23d19421a0b2cc1742a0cefe428b)) + ## [7.4.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@7.4.0...@patternfly/react-charts@7.4.1) (2024-09-13) ### Bug Fixes diff --git a/packages/react-charts/package.json b/packages/react-charts/package.json index 4f7665c46ce..c6d2909c66e 100644 --- a/packages/react-charts/package.json +++ b/packages/react-charts/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-charts", - "version": "7.4.1", + "version": "7.4.5", "description": "This library provides a set of React chart components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -32,7 +32,7 @@ "@patternfly/react-tokens": "workspace:^", "hoist-non-react-statics": "^3.3.2", "lodash": "^4.17.21", - "tslib": "^2.6.3", + "tslib": "^2.7.0", "victory-area": "^37.1.1", "victory-axis": "^37.1.1", "victory-bar": "^37.1.1", @@ -60,7 +60,7 @@ "build:single:packages": "node ../../scripts/build-single-packages.js --config single-packages.config.json" }, "devDependencies": { - "@types/lodash": "^4.17.7", + "@types/lodash": "^4.17.9", "fs-extra": "^11.2.0" } } diff --git a/packages/react-charts/src/components/ChartArea/examples/ChartArea.md b/packages/react-charts/src/components/ChartArea/examples/ChartArea.md index 6041a95f4d2..cba89769979 100644 --- a/packages/react-charts/src/components/ChartArea/examples/ChartArea.md +++ b/packages/react-charts/src/components/ChartArea/examples/ChartArea.md @@ -127,7 +127,7 @@ class BottomAlignedLegend extends React.Component { themeColor={ChartThemeColor.cyan} width={650} > - + { - props = evaluateProps(props); + props = evaluateProps({ + pathComponent: , + role: 'presentation', + shapeRendering: 'auto', + ...props + }); return React.cloneElement(props.pathComponent, { ...props.events, @@ -125,10 +130,4 @@ const ChartCursorFlyout = (props: ChartCursorFlyoutProps) => { }); }; -ChartCursorFlyout.defaultProps = { - pathComponent: , - role: 'presentation', - shapeRendering: 'auto' -}; - export { ChartCursorFlyout }; diff --git a/packages/react-charts/src/components/ChartUtils/chart-container.tsx b/packages/react-charts/src/components/ChartUtils/chart-container.tsx index 189e508afe3..c3e58f0b1db 100644 --- a/packages/react-charts/src/components/ChartUtils/chart-container.tsx +++ b/packages/react-charts/src/components/ChartUtils/chart-container.tsx @@ -26,25 +26,30 @@ import { LineSegment } from 'victory-core'; * @public */ export const createContainer = (behaviorA: ContainerType, behaviorB: ContainerType) => { - const container: any = victoryCreateContainer(behaviorA, behaviorB); + const Container: any = victoryCreateContainer(behaviorA, behaviorB); const isCursor = behaviorA === 'cursor' || behaviorB === 'cursor'; const isVoronoi = behaviorA === 'voronoi' || behaviorB === 'voronoi'; - if (!container?.defaultProps) { - container.defaultProps = {}; - } - if (isCursor) { - container.defaultProps.cursorLabelComponent = ; - container.defaultProps.cursorComponent = ( - - ); - } - if (isVoronoi) { - container.defaultProps.labelComponent = ; - } - return container; + const containerWrapper = (props: any) => { + const containerProps = { + ...(isCursor && { + cursorLabelComponent: , + cursorComponent: ( + + ) + }), + ...(isVoronoi && { labelComponent: }), + ...props + }; + return ; + }; + containerWrapper.defaultEvents = Container.defaultEvents; + containerWrapper.displayName = Container.displayName; + containerWrapper.role = Container.role; + + return containerWrapper; }; diff --git a/packages/react-charts/src/components/ChartUtils/chart-tooltip.ts b/packages/react-charts/src/components/ChartUtils/chart-tooltip.ts index 1be193feb2f..fe7c369365f 100644 --- a/packages/react-charts/src/components/ChartUtils/chart-tooltip.ts +++ b/packages/react-charts/src/components/ChartUtils/chart-tooltip.ts @@ -92,7 +92,7 @@ export const getCursorTooltipPoniterOrientation = ({ * Returns props associated with legend data * @private */ -export const getLegendTooltipDataProps = (defaultProps: ChartLegendProps) => +export const getLegendTooltipDataProps = (props: ChartLegendProps) => merge( { borderPadding: 0, @@ -112,7 +112,7 @@ export const getLegendTooltipDataProps = (defaultProps: ChartLegendProps) => } } }, - { ...defaultProps } + { ...props } ); /** diff --git a/packages/react-charts/src/components/ChartVoronoiContainer/ChartVoronoiContainer.tsx b/packages/react-charts/src/components/ChartVoronoiContainer/ChartVoronoiContainer.tsx index 307ff55014b..1c8f1040ba6 100644 --- a/packages/react-charts/src/components/ChartVoronoiContainer/ChartVoronoiContainer.tsx +++ b/packages/react-charts/src/components/ChartVoronoiContainer/ChartVoronoiContainer.tsx @@ -249,7 +249,6 @@ export const ChartVoronoiContainer: React.FunctionComponent = ({ @@ -91,7 +95,9 @@ const DropdownBase: React.FunctionComponent = ({ onOpenChangeKeys = ['Escape', 'Tab'], menuHeight, maxMenuHeight, - shouldFocusFirstItemOnOpen = true, + shouldFocusFirstItemOnOpen = false, + shouldPreventScrollOnItemFocus = true, + focusTimeoutDelay = 0, ...props }: DropdownProps) => { const localMenuRef = React.useRef(); @@ -126,8 +132,8 @@ const DropdownBase: React.FunctionComponent = ({ const firstElement = menuRef?.current?.querySelector( 'li button:not(:disabled),li input:not(:disabled),li a:not([aria-disabled="true"])' ); - firstElement && (firstElement as HTMLElement).focus(); - }, 10); + firstElement && (firstElement as HTMLElement).focus({ preventScroll: shouldPreventScrollOnItemFocus }); + }, focusTimeoutDelay); } // If the event is not on the toggle and onOpenChange callback is provided, close the menu @@ -145,7 +151,16 @@ const DropdownBase: React.FunctionComponent = ({ window.removeEventListener('keydown', handleMenuKeys); window.removeEventListener('click', handleClick); }; - }, [isOpen, menuRef, toggleRef, onOpenChange, onOpenChangeKeys]); + }, [ + isOpen, + menuRef, + toggleRef, + onOpenChange, + onOpenChangeKeys, + shouldPreventScrollOnItemFocus, + shouldFocusFirstItemOnOpen, + focusTimeoutDelay + ]); const scrollable = maxMenuHeight !== undefined || menuHeight !== undefined || isScrollable; @@ -155,7 +170,7 @@ const DropdownBase: React.FunctionComponent = ({ ref={menuRef} onSelect={(event, value) => { onSelect && onSelect(event, value); - shouldFocusToggleOnSelect && toggleRef.current.focus(); + shouldFocusToggleOnSelect && toggleRef.current?.focus(); }} isPlain={isPlain} isScrollable={scrollable} diff --git a/packages/react-core/src/components/ExpandableSection/ExpandableSection.tsx b/packages/react-core/src/components/ExpandableSection/ExpandableSection.tsx index 27c26cce648..e1d338a4a4f 100644 --- a/packages/react-core/src/components/ExpandableSection/ExpandableSection.tsx +++ b/packages/react-core/src/components/ExpandableSection/ExpandableSection.tsx @@ -70,7 +70,7 @@ export interface ExpandableSectionProps extends React.HTMLProps interface ExpandableSectionState { isExpanded: boolean; hasToggle: boolean; - previousWidth: number; + previousWidth?: number; } const setLineClamp = (lines: number, element: HTMLDivElement) => { @@ -87,7 +87,7 @@ class ExpandableSection extends React.Component { - if (this.expandableContentRef.current) { - const { offsetWidth } = this.expandableContentRef.current; - if (this.state.previousWidth !== offsetWidth) { - this.setState({ previousWidth: offsetWidth }); - this.checkToggleVisibility(); - } + if (!this.expandableContentRef.current) { + return; + } + const { offsetWidth } = this.expandableContentRef.current; + if (this.state.previousWidth !== offsetWidth) { + this.setState({ previousWidth: offsetWidth }); + this.checkToggleVisibility(); } }; handleResize = debounce(this.resize, 250); @@ -221,7 +227,7 @@ class ExpandableSection extends React.Component { - this.setState({ isExpanded: isOpen }, () => onToggleProp(event, this.state.isExpanded)); + this.setState({ isExpanded: isOpen }, () => onToggleProp?.(event, this.state.isExpanded)); }; } @@ -239,7 +245,7 @@ class ExpandableSection extends React.Component onToggle(event, !propOrStateIsExpanded)} + onClick={(event) => onToggle?.(event, !propOrStateIsExpanded)} > {variant !== ExpandableSectionVariant.truncate && ( diff --git a/packages/react-core/src/components/ExpandableSection/__tests__/__snapshots__/ExpandableSection.test.tsx.snap b/packages/react-core/src/components/ExpandableSection/__tests__/__snapshots__/ExpandableSection.test.tsx.snap index d87bc00aaa6..e2ea7b32446 100644 --- a/packages/react-core/src/components/ExpandableSection/__tests__/__snapshots__/ExpandableSection.test.tsx.snap +++ b/packages/react-core/src/components/ExpandableSection/__tests__/__snapshots__/ExpandableSection.test.tsx.snap @@ -58,6 +58,7 @@ exports[`Disclosure ExpandableSection 1`] = ` >