From dba392d62011b1adc38ab0d22a2ad91e0e7d2a2e Mon Sep 17 00:00:00 2001 From: Titani Labaj <39532947+tlabaj@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:48:33 -0500 Subject: [PATCH] feat(Navigation): Penta updates for nav (#9948) * feat(Navigation): Penta updates for nav --- packages/react-core/package.json | 2 +- .../react-core/src/components/Nav/Nav.tsx | 16 +- .../src/components/Nav/NavExpandable.tsx | 1 - .../react-core/src/components/Nav/NavItem.tsx | 6 +- .../react-core/src/components/Nav/NavList.tsx | 45 +- .../__snapshots__/NavExpandable.test.tsx.snap | 2 +- .../src/components/Nav/__tests__/Nav.test.tsx | 34 +- .../__tests__/__snapshots__/Nav.test.tsx.snap | 518 ++++++------------ .../src/components/Nav/examples/Nav.md | 6 - .../components/Nav/examples/NavExpandable.tsx | 3 +- .../Nav/examples/NavLegacyTertiary.tsx | 32 -- .../src/components/Nav/examples/nav.css | 14 - .../react-core/src/components/Page/Page.tsx | 32 +- .../components/Page/__tests__/Page.test.tsx | 10 +- .../__snapshots__/Page.test.tsx.snap | 284 ++++++---- .../src/components/Page/examples/Page.md | 12 +- .../Page/examples/PageGroupSection.tsx | 2 +- .../Page/examples/PageTertiaryNav.tsx | 41 -- packages/react-core/src/demos/Nav.md | 10 - ...stheadWithUtilitiesAndUserDropdownMenu.tsx | 3 +- .../examples/Nav/deprecated/NavLight.tsx | 95 ---- .../examples/Nav/deprecated/NavTertiary.tsx | 91 --- packages/react-docs/package.json | 2 +- packages/react-icons/package.json | 2 +- .../cypress/integration/nav.spec.ts | 18 - .../src/components/demos/NavDemo/NavDemo.tsx | 41 +- packages/react-styles/package.json | 2 +- packages/react-tokens/package.json | 2 +- yarn.lock | 8 +- 29 files changed, 408 insertions(+), 926 deletions(-) delete mode 100644 packages/react-core/src/components/Nav/examples/NavLegacyTertiary.tsx delete mode 100644 packages/react-core/src/components/Page/examples/PageTertiaryNav.tsx delete mode 100644 packages/react-core/src/demos/examples/Nav/deprecated/NavLight.tsx delete mode 100644 packages/react-core/src/demos/examples/Nav/deprecated/NavTertiary.tsx diff --git a/packages/react-core/package.json b/packages/react-core/package.json index f5a8c4cb903..03cdc95646b 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -54,7 +54,7 @@ "tslib": "^2.5.0" }, "devDependencies": { - "@patternfly/patternfly": "6.0.0-alpha.49", + "@patternfly/patternfly": "6.0.0-alpha.51", "@rollup/plugin-commonjs": "^25.0.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-replace": "^5.0.2", diff --git a/packages/react-core/src/components/Nav/Nav.tsx b/packages/react-core/src/components/Nav/Nav.tsx index 6fe6eb9ca73..b0cd44730ed 100644 --- a/packages/react-core/src/components/Nav/Nav.tsx +++ b/packages/react-core/src/components/Nav/Nav.tsx @@ -35,10 +35,8 @@ export interface NavProps ) => void; /** Accessible label for the nav when there are multiple navs on the page */ 'aria-label'?: string; - /** Indicates which theme color to use */ - theme?: 'dark' | 'light'; /** For horizontal navs */ - variant?: 'default' | 'horizontal' | 'tertiary' | 'horizontal-subnav'; + variant?: 'default' | 'horizontal' | 'horizontal-subnav'; /** Value to overwrite the randomly generated data-ouia-component-id.*/ ouiaId?: number | string; /** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */ @@ -72,7 +70,6 @@ class Nav extends React.Component< static defaultProps: NavProps = { onSelect: () => undefined, onToggle: () => undefined, - theme: 'dark', ouiaSafe: true }; @@ -121,13 +118,12 @@ class Nav extends React.Component< onSelect, // eslint-disable-next-line @typescript-eslint/no-unused-vars onToggle, - theme, ouiaId, ouiaSafe, variant, ...props } = this.props; - const isHorizontal = ['horizontal', 'tertiary'].includes(variant); + const isHorizontal = ['horizontal', 'horizontal-subnav'].includes(variant); return ( , groupId: number | string, expanded: boolean) => this.onToggle(event, groupId, expanded), updateIsScrollable: (isScrollable: boolean) => this.setState({ isScrollable }), - isHorizontal: ['horizontal', 'tertiary', 'horizontal-subnav'].includes(variant), + isHorizontal: ['horizontal', 'horizontal-subnav'].includes(variant), flyoutRef: this.state.flyoutRef, setFlyoutRef: (flyoutRef) => this.setState({ flyoutRef }), navRef: this.navRef @@ -157,14 +153,12 @@ class Nav extends React.Component<