diff --git a/.gitignore b/.gitignore index ba24b08e..61cca10e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ coverage .cache .tmp .eslintcache +.cache_* # package managers yarn-error.log diff --git a/packages/demo-app-ts/package.json b/packages/demo-app-ts/package.json index 3f6aee24..cb542306 100644 --- a/packages/demo-app-ts/package.json +++ b/packages/demo-app-ts/package.json @@ -9,9 +9,9 @@ "serve:demo-app": "node scripts/serve" }, "dependencies": { - "@patternfly/react-core": "5.0.0-alpha.51", - "@patternfly/react-icons": "5.0.0-alpha.7", - "@patternfly/react-styles": "5.0.0-alpha.5", + "@patternfly/react-core": "5.0.0-prerelease.7", + "@patternfly/react-icons": "5.0.0-prerelease.3", + "@patternfly/react-styles": "5.0.0-prerelease.2", "react": "^18", "react-dom": "^18", "react-router": "^5.3.3", diff --git a/packages/demo-app-ts/src/App.tsx b/packages/demo-app-ts/src/App.tsx index c7b53358..2782a24d 100755 --- a/packages/demo-app-ts/src/App.tsx +++ b/packages/demo-app-ts/src/App.tsx @@ -1,20 +1,24 @@ import React from 'react'; import { BrowserRouter as Router, Route, Link, Switch } from 'react-router-dom'; import { - Page, - Nav, - NavList, - NavItem, - PageSection, - PageSidebar, - Avatar, - Brand, - PageHeader, - PageHeaderTools, - PageHeaderToolsItem, - PageHeaderToolsGroup, - Radio, NavExpandable + Page, + Nav, + NavList, + NavItem, + PageSection, + PageSidebar, + Avatar, + Brand, + Radio, + NavExpandable, + PageSidebarBody } from '@patternfly/react-core'; +import { + PageHeader, + PageHeaderTools, + PageHeaderToolsItem, + PageHeaderToolsGroup +} from '@patternfly/react-core/deprecated'; import imgBrand from './assets/images/imgBrand.svg'; import imgAvatar from './assets/images/imgAvatar.svg'; import Demos from './Demos'; @@ -39,7 +43,7 @@ class App extends React.Component<{}, AppState> { isDarkTheme: false }; - private onNavSelect = (selectedItem: { itemId: number | string; groupId: number | string }) => { + private onNavSelect = (_event:any, selectedItem: { itemId: number | string; groupId: number | string }) => { this.setState({ activeItem: selectedItem.itemId }); }; @@ -125,7 +129,7 @@ class App extends React.Component<{}, AppState> { label={`Light theme`} name="light-theme" isChecked={!isDarkTheme} - onChange={checked => checked && this.onThemeSelect(false)} + onChange={(_event: any, checked: boolean) => checked && this.onThemeSelect(false)} /> @@ -135,7 +139,7 @@ class App extends React.Component<{}, AppState> { aria-label="Dark theme" name="dark-theme" isChecked={isDarkTheme} - onChange={checked => checked && this.onThemeSelect(true)} + onChange={(_event: any, checked: boolean) => checked && this.onThemeSelect(true)} /> @@ -182,7 +186,11 @@ class App extends React.Component<{}, AppState> { ); - const AppSidebar = ; + const AppSidebar = ( + + {nav} + + ); return ( diff --git a/packages/demo-app-ts/src/Demo.css b/packages/demo-app-ts/src/Demo.css index 06c5e025..a89db665 100644 --- a/packages/demo-app-ts/src/Demo.css +++ b/packages/demo-app-ts/src/Demo.css @@ -6,35 +6,35 @@ } .pf-ri__topology-demo .pf-topology-visualization-surface { - border: 1px solid var(--pf-global--BorderColor--100); + border: 1px solid var(--pf-v5-global--BorderColor--100); border-top: none; } -.pf-ri__topology-demo .pf-c-tab-content { +.pf-ri__topology-demo .pf-v5-c-tab-content { display: flex; flex-direction: column; flex-grow: 1; } -.pf-ri__topology-demo .pf-c-tab-content:focus { +.pf-ri__topology-demo .pf-v5-c-tab-content:focus { outline: none; } -.pf-ri__topology-demo .pf-c-toolbar { - --pf-c-toolbar__expandable-content--lg--PaddingBottom: 0; - --pf-c-toolbar--PaddingBottom: 0; +.pf-ri__topology-demo .pf-v5-c-toolbar { + --pf-v5-c-toolbar__expandable-content--lg--PaddingBottom: 0; + --pf-v5-c-toolbar--PaddingBottom: 0; } -.pf-ri__topology-demo .pf-c-toolbar__item .pf-l-flex { - --pf-l-flex--FlexWrap: no-wrap; +.pf-ri__topology-demo .pf-v5-c-toolbar__item .pf-v5-l-flex { + --pf-v5-l-flex--FlexWrap: no-wrap; } -.pf-ri__topology-demo .pf-c-toolbar__item .pf-c-form-control { +.pf-ri__topology-demo .pf-v5-c-toolbar__item .pf-v5-c-form-control { width: 85px; } .pf-ri-topology-context-menu { z-index: 1050; } -.pf-ri-topology-context-menu__kebab-wrapper.pf-c-dropdown__menu-item { +.pf-ri-topology-context-menu__kebab-wrapper.pf-v5-c-dropdown__menu-item { padding: 0; } .pf-ri__topology-demo__package-input { @@ -42,33 +42,33 @@ } .pf-ri-topology__node__background { - fill: var(--pf-global--palette--black-400); + fill: var(--pf-v5-global--palette--black-400); stroke-width: 1px; - stroke: var(--pf-global--palette--black-1000); + stroke: var(--pf-v5-global--palette--black-1000); } .pf-ri-topology__node__background.pf-m-selected { - fill: var(--pf-global--active-color--100); + fill: var(--pf-v5-global--active-color--100); } .pf-ri-topology__node__background.pf-m-hover { - fill: var(--pf-global--palette--green-300); + fill: var(--pf-v5-global--palette--green-300); } .pf-ri-topology__node__background.pf-m-drop-target { - fill: var(--pf-global--palette--light-blue-200); + fill: var(--pf-v5-global--palette--light-blue-200); } -.pf-c-page__main-section#\/topology-demo-page-section, .pf-c-page__main-section#\/topology-pipelines-demo-page-section { - --pf-c-page__main-section--PaddingTop: 0; - --pf-c-page__main-section--PaddingRight: 0; - --pf-c-page__main-section--PaddingLeft: 0; - --pf-c-page__main-section--PaddingBottom: 0; +.pf-v5-c-page__main-section#\/topology-demo-page-section, .pf-v5-c-page__main-section#\/topology-pipelines-demo-page-section { + --pf-v5-c-page__main-section--PaddingTop: 0; + --pf-v5-c-page__main-section--PaddingRight: 0; + --pf-v5-c-page__main-section--PaddingLeft: 0; + --pf-v5-c-page__main-section--PaddingBottom: 0; } .topology-demo-badge > rect { - fill: var(--pf-global--palette--red-100); + fill: var(--pf-v5-global--palette--red-100); } .topology-demo-badge > text { - fill: var(--pf-global--palette--gold-100); + fill: var(--pf-v5-global--palette--gold-100); } diff --git a/packages/demo-app-ts/src/utils/useTopologyOptions.tsx b/packages/demo-app-ts/src/utils/useTopologyOptions.tsx index 0104b686..7b3f36ce 100644 --- a/packages/demo-app-ts/src/utils/useTopologyOptions.tsx +++ b/packages/demo-app-ts/src/utils/useTopologyOptions.tsx @@ -3,9 +3,6 @@ import * as _ from 'lodash'; import { Button, Flex, - Select, - SelectOption, - SelectVariant, Split, SplitItem, TextInput, @@ -16,7 +13,10 @@ import { Dropdown as DropdownDeprecated, DropdownItem as DropdownItemDeprecated, DropdownPosition as DropdownPositionDeprecated, - DropdownToggle as DropdownToggleDeprecated + DropdownToggle as DropdownToggleDeprecated, + Select, + SelectOption, + SelectVariant } from '@patternfly/react-core/deprecated'; import { DefaultEdgeOptions, DefaultNodeOptions, GeneratorEdgeOptions, GeneratorNodeOptions } from '../data/generator'; import { @@ -71,7 +71,7 @@ export const useTopologyOptions = ( const layoutDropdown = ( - + (val ? updateValue(parseInt(val), 0, 9999, setNumNodes) : setNumNodes(null))} + onChange={(_event, val: string) => (val ? updateValue(parseInt(val), 0, 9999, setNumNodes) : setNumNodes(null))} /> Edges: (val ? updateValue(parseInt(val), 0, 200, setNumEdges) : setNumEdges(null))} + onChange={(_event, val: string) => (val ? updateValue(parseInt(val), 0, 200, setNumEdges) : setNumEdges(null))} /> Groups: (val ? updateValue(parseInt(val), 0, 100, setNumGroups) : setNumGroups(null))} + onChange={(_event, val: string) => (val ? updateValue(parseInt(val), 0, 100, setNumGroups) : setNumGroups(null))} /> Nesting Depth: (val ? updateValue(parseInt(val), 0, 5, setNestedLevel) : setNestedLevel(null))} + onChange={(_event, val: string) => (val ? updateValue(parseInt(val), 0, 5, setNestedLevel) : setNestedLevel(null))} />