diff --git a/.github/promote.sh b/.github/promote.sh index 31155935a6b..37187f2372b 100755 --- a/.github/promote.sh +++ b/.github/promote.sh @@ -18,8 +18,15 @@ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc # npm pkg set devDependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @patternfly/react-core --workspace @patternfly/react-styles --workspace @patternfly/react-tokens --workspace @patternfly/react-icons #fi +# use lerna command to perform a patch releaes: +yarn run lerna publish patch --dist-tag=latest --no-private --yes 2>&1 | tee lerna-output.txt + +# use lerna command below for dry run of patch release +# yarn run lerna version patch --yes --no-git-tag-version --no-push --no-private | tee lerna-output.txt + + # publish to npm -yarn run lerna publish --conventional-commits --conventional-graduate --no-private --dist-tag=latest --yes +#yarn run lerna publish --conventional-commits --conventional-graduate --no-private --dist-tag=latest --yes # immediately after promote - set up repo for next prerelease # yarn run lerna version preminor --force-publish --conventional-commits --no-private --yes --preid prerelease diff --git a/lerna.json b/lerna.json index 69ac0a90549..ccb512f255d 100644 --- a/lerna.json +++ b/lerna.json @@ -24,7 +24,7 @@ } }, "version": "independent", - "allowBranch": ["main", "v4", "5.0.x", "v5"], + "allowBranch": ["main", "6.3.x", "v4", "5.0.x", "v5"], "packages": ["packages/*", "packages/react-integration/demo-app-ts"], "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/packages/eslint-plugin-patternfly-react/CHANGELOG.md b/packages/eslint-plugin-patternfly-react/CHANGELOG.md index 1d65b2768c2..3f859ab0a26 100644 --- a/packages/eslint-plugin-patternfly-react/CHANGELOG.md +++ b/packages/eslint-plugin-patternfly-react/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 6.3.1 (2025-08-05) + +**Note:** Version bump only for package eslint-plugin-patternfly-react + # 6.3.0 (2025-07-22) **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 c42d04a590f..ad13499168b 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": "6.3.0", + "version": "6.3.1", "type": "commonjs", "exports": { ".": "./lib/index.js" diff --git a/packages/react-charts/CHANGELOG.md b/packages/react-charts/CHANGELOG.md index 79aee1d0faf..4f23da1e37b 100644 --- a/packages/react-charts/CHANGELOG.md +++ b/packages/react-charts/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 8.3.1 (2025-08-05) + +**Note:** Version bump only for package @patternfly/react-charts + # 8.3.0 (2025-07-22) **Note:** Version bump only for package @patternfly/react-charts diff --git a/packages/react-charts/package.json b/packages/react-charts/package.json index 0e5792a2d66..442e2e1c93b 100644 --- a/packages/react-charts/package.json +++ b/packages/react-charts/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-charts", - "version": "8.3.0", + "version": "8.3.1", "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", diff --git a/packages/react-code-editor/CHANGELOG.md b/packages/react-code-editor/CHANGELOG.md index 4a834cba7e7..f04cae65fdc 100644 --- a/packages/react-code-editor/CHANGELOG.md +++ b/packages/react-code-editor/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 6.3.1 (2025-08-05) + +**Note:** Version bump only for package @patternfly/react-code-editor + # 6.3.0 (2025-07-22) **Note:** Version bump only for package @patternfly/react-code-editor diff --git a/packages/react-code-editor/package.json b/packages/react-code-editor/package.json index d60730e7fe5..2ca92b4975e 100644 --- a/packages/react-code-editor/package.json +++ b/packages/react-code-editor/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-code-editor", - "version": "6.3.0", + "version": "6.3.1", "description": "This package provides a PatternFly wrapper for the Monaco code editor\n", "main": "dist/js/index.js", "module": "dist/esm/index.js", diff --git a/packages/react-core/CHANGELOG.md b/packages/react-core/CHANGELOG.md index 450281e598e..340a898cf78 100644 --- a/packages/react-core/CHANGELOG.md +++ b/packages/react-core/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 6.3.1 (2025-08-05) + +**Note:** Version bump only for package @patternfly/react-core + # 6.3.0 (2025-07-22) **Note:** Version bump only for package @patternfly/react-core diff --git a/packages/react-core/package.json b/packages/react-core/package.json index e6342dc9893..2a4dccf1db4 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-core", - "version": "6.3.0", + "version": "6.3.1", "description": "This library provides a set of common React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -54,7 +54,7 @@ "tslib": "^2.8.1" }, "devDependencies": { - "@patternfly/patternfly": "6.3.0-prerelease.41", + "@patternfly/patternfly": "6.3.1", "case-anything": "^3.1.2", "css": "^3.0.0", "fs-extra": "^11.3.0" diff --git a/packages/react-core/src/components/Page/PageToggleButton.tsx b/packages/react-core/src/components/Page/PageToggleButton.tsx index de43ece168d..dce88f6f58c 100644 --- a/packages/react-core/src/components/Page/PageToggleButton.tsx +++ b/packages/react-core/src/components/Page/PageToggleButton.tsx @@ -14,6 +14,8 @@ export interface PageToggleButtonProps extends ButtonProps { 'aria-label'?: string; /** Flag indicating whether the hamburger button variation with animations should be used. */ isHamburgerButton?: boolean; + /** IsHamburgerButton must be true for hamburgerVariant to be have an effect. Adjusts and animates the hamburger icon to indicate what will happen upon clicking the button. */ + hamburgerVariant?: 'expand' | 'collapse'; } export const PageToggleButton: React.FunctionComponent = ({ @@ -23,6 +25,7 @@ export const PageToggleButton: React.FunctionComponent = id = 'nav-toggle', 'aria-label': ariaLabel = 'Side navigation toggle', isHamburgerButton, + hamburgerVariant, ...props }: PageToggleButtonProps) => ( @@ -42,6 +45,10 @@ export const PageToggleButton: React.FunctionComponent = aria-expanded={sidebarOpen ? 'true' : 'false'} variant={ButtonVariant.plain} isHamburger={isHamburgerButton} + hamburgerVariant={hamburgerVariant} + {...(isHamburgerButton && { + isExpanded: sidebarOpen + })} {...props} > {!isHamburgerButton && children} diff --git a/packages/react-core/src/components/Page/__tests__/PageToggleButton.test.tsx b/packages/react-core/src/components/Page/__tests__/PageToggleButton.test.tsx new file mode 100644 index 00000000000..8fa14c82710 --- /dev/null +++ b/packages/react-core/src/components/Page/__tests__/PageToggleButton.test.tsx @@ -0,0 +1,74 @@ +import { render, screen } from '@testing-library/react'; +import { PageToggleButton } from '../PageToggleButton'; +import { PageContextProvider } from '../PageContext'; + +test('Renders without children', () => { + render( +
+ +
+ ); + + expect(screen.getByTestId('container').firstChild).toBeVisible(); +}); + +test('Renders with children', () => { + render(Test); + + expect(screen.getByText('Test')).toBeVisible(); +}); + +test('Throws console error when isHamburger is true and isSidebarOpen is not passed', () => { + const consoleError = jest.spyOn(console, 'error').mockImplementation(); + + render(); + + expect(consoleError).toHaveBeenCalledWith( + 'Button: when the isHamburger property is passed in, you must also pass in a boolean value to the isExpanded property. It is expected that a hamburger button controls the expansion of other content.' + ); +}); + +test('Does not throw console error when isHamburger is true and isSidebarOpen is false', () => { + const consoleError = jest.spyOn(console, 'error').mockImplementation(); + + render(); + + expect(consoleError).not.toHaveBeenCalledWith( + 'Button: when the isHamburger property is passed in, you must also pass in a boolean value to the isExpanded property. It is expected that a hamburger button controls the expansion of other content..' + ); +}); + +test('Does not throw console error when isHamburger is true and isSidebarOpen is true', () => { + const consoleError = jest.spyOn(console, 'error').mockImplementation(); + + render(); + + expect(consoleError).not.toHaveBeenCalledWith( + 'Button: when the isHamburger property is passed in, you must also pass in a boolean value to the isExpanded property. It is expected that a hamburger button controls the expansion of other content..' + ); +}); + +// assisted by AI/Cursor +test('Does not throw console error when isHamburger is true, isSidebarOpen is not passed, but managedIsSidebarOpen is true', () => { + const consoleError = jest.spyOn(console, 'error').mockImplementation(); + + const mockPageContext = { + isManagedSidebar: true, + onSidebarToggle: () => null, + isSidebarOpen: true, // managedIsSidebarOpen is true + width: 1024, + height: 768, + getBreakpoint: () => 'lg' as const, + getVerticalBreakpoint: () => 'lg' as const + }; + + render( + + + + ); + + expect(consoleError).not.toHaveBeenCalledWith( + 'Button: when the isHamburger property is passed in, you must also pass in a boolean value to the isExpanded property. It is expected that a hamburger button controls the expansion of other content..' + ); +}); diff --git a/packages/react-core/src/components/TextArea/TextArea.tsx b/packages/react-core/src/components/TextArea/TextArea.tsx index 267e67728af..cc52d94e76c 100644 --- a/packages/react-core/src/components/TextArea/TextArea.tsx +++ b/packages/react-core/src/components/TextArea/TextArea.tsx @@ -62,13 +62,15 @@ class TextAreaBase extends Component { const parent = field.parentElement; parent.style.setProperty('height', 'inherit'); const computed = window.getComputedStyle(field); + const parentComputed = window.getComputedStyle(parent); // Calculate the height const height = parseInt(computed.getPropertyValue('border-top-width')) + - parseInt(computed.getPropertyValue('padding-top')) + field.scrollHeight + - parseInt(computed.getPropertyValue('padding-bottom')) + - parseInt(computed.getPropertyValue('border-bottom-width')); + parseInt(computed.getPropertyValue('border-bottom-width')) + + parseInt(parentComputed.getPropertyValue('padding-top')) + + parseInt(parentComputed.getPropertyValue('padding-bottom')); + parent.style.setProperty('height', `${height}px`); }; diff --git a/packages/react-core/src/components/TextArea/__tests__/__snapshots__/TextArea.test.tsx.snap b/packages/react-core/src/components/TextArea/__tests__/__snapshots__/TextArea.test.tsx.snap index 3ec7f3e5991..668f16aee72 100644 --- a/packages/react-core/src/components/TextArea/__tests__/__snapshots__/TextArea.test.tsx.snap +++ b/packages/react-core/src/components/TextArea/__tests__/__snapshots__/TextArea.test.tsx.snap @@ -4,7 +4,7 @@ exports[`Matches the snapshot 1`] = `