@patternfly/react-core 5.0.0-alpha.53 → 5.0.0-alpha.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/esm/components/Form/FormGroup.d.ts +0 -16
- package/dist/esm/components/Form/FormGroup.d.ts.map +1 -1
- package/dist/esm/components/Form/FormGroup.js +3 -15
- package/dist/esm/components/Form/FormGroup.js.map +1 -1
- package/dist/esm/components/Form/FormHelperText.d.ts +2 -10
- package/dist/esm/components/Form/FormHelperText.d.ts.map +1 -1
- package/dist/esm/components/Form/FormHelperText.js +2 -5
- package/dist/esm/components/Form/FormHelperText.js.map +1 -1
- package/dist/esm/components/LoginPage/LoginForm.d.ts.map +1 -1
- package/dist/esm/components/LoginPage/LoginForm.js +6 -3
- package/dist/esm/components/LoginPage/LoginForm.js.map +1 -1
- package/dist/esm/components/Page/Page.d.ts +2 -2
- package/dist/esm/components/Page/Page.d.ts.map +1 -1
- package/dist/esm/components/Page/index.d.ts +0 -4
- package/dist/esm/components/Page/index.d.ts.map +1 -1
- package/dist/esm/components/Page/index.js +0 -4
- package/dist/esm/components/Page/index.js.map +1 -1
- package/dist/esm/deprecated/components/PageHeader/PageHeader.d.ts.map +1 -0
- package/dist/esm/{components/Page → deprecated/components/PageHeader}/PageHeader.js +2 -2
- package/dist/esm/deprecated/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/esm/deprecated/components/PageHeader/PageHeaderTools.d.ts.map +1 -0
- package/dist/esm/deprecated/components/PageHeader/PageHeaderTools.js.map +1 -0
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsGroup.d.ts.map +1 -0
- package/dist/esm/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsGroup.js +2 -2
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsGroup.js.map +1 -0
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts.map +1 -0
- package/dist/esm/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsItem.js +2 -2
- package/dist/esm/deprecated/components/PageHeader/PageHeaderToolsItem.js.map +1 -0
- package/dist/esm/deprecated/components/PageHeader/index.d.ts +5 -0
- package/dist/esm/deprecated/components/PageHeader/index.d.ts.map +1 -0
- package/dist/esm/deprecated/components/PageHeader/index.js +5 -0
- package/dist/esm/deprecated/components/PageHeader/index.js.map +1 -0
- package/dist/esm/deprecated/components/index.d.ts +1 -0
- package/dist/esm/deprecated/components/index.d.ts.map +1 -1
- package/dist/esm/deprecated/components/index.js +1 -0
- package/dist/esm/deprecated/components/index.js.map +1 -1
- package/dist/js/components/Form/FormGroup.d.ts +0 -16
- package/dist/js/components/Form/FormGroup.d.ts.map +1 -1
- package/dist/js/components/Form/FormGroup.js +3 -15
- package/dist/js/components/Form/FormGroup.js.map +1 -1
- package/dist/js/components/Form/FormHelperText.d.ts +2 -10
- package/dist/js/components/Form/FormHelperText.d.ts.map +1 -1
- package/dist/js/components/Form/FormHelperText.js +2 -5
- package/dist/js/components/Form/FormHelperText.js.map +1 -1
- package/dist/js/components/LoginPage/LoginForm.d.ts.map +1 -1
- package/dist/js/components/LoginPage/LoginForm.js +6 -3
- package/dist/js/components/LoginPage/LoginForm.js.map +1 -1
- package/dist/js/components/Page/Page.d.ts +2 -2
- package/dist/js/components/Page/Page.d.ts.map +1 -1
- package/dist/js/components/Page/index.d.ts +0 -4
- package/dist/js/components/Page/index.d.ts.map +1 -1
- package/dist/js/components/Page/index.js +0 -4
- package/dist/js/components/Page/index.js.map +1 -1
- package/dist/js/deprecated/components/PageHeader/PageHeader.d.ts.map +1 -0
- package/dist/js/{components/Page → deprecated/components/PageHeader}/PageHeader.js +2 -2
- package/dist/js/deprecated/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/js/deprecated/components/PageHeader/PageHeaderTools.d.ts.map +1 -0
- package/dist/js/deprecated/components/PageHeader/PageHeaderTools.js.map +1 -0
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsGroup.d.ts.map +1 -0
- package/dist/js/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsGroup.js +2 -2
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsGroup.js.map +1 -0
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.d.ts.map +1 -0
- package/dist/js/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsItem.js +2 -2
- package/dist/js/deprecated/components/PageHeader/PageHeaderToolsItem.js.map +1 -0
- package/dist/js/deprecated/components/PageHeader/index.d.ts +5 -0
- package/dist/js/deprecated/components/PageHeader/index.d.ts.map +1 -0
- package/dist/js/deprecated/components/PageHeader/index.js +8 -0
- package/dist/js/deprecated/components/PageHeader/index.js.map +1 -0
- package/dist/js/deprecated/components/index.d.ts +1 -0
- package/dist/js/deprecated/components/index.d.ts.map +1 -1
- package/dist/js/deprecated/components/index.js +1 -0
- package/dist/js/deprecated/components/index.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/FileUpload/examples/FileUploadTextWithRestrictions.tsx +9 -7
- package/src/components/Form/FormGroup.tsx +1 -60
- package/src/components/Form/FormHelperText.tsx +7 -31
- package/src/components/Form/__tests__/FormGroup.test.tsx +6 -95
- package/src/components/Form/__tests__/FormHelperText.test.tsx +1 -14
- package/src/components/Form/__tests__/__snapshots__/FormGroup.test.tsx.snap +0 -211
- package/src/components/Form/__tests__/__snapshots__/FormHelperText.test.tsx.snap +12 -39
- package/src/components/Form/examples/Form.md +15 -1
- package/src/components/Form/examples/FormBasic.tsx +19 -3
- package/src/components/Form/examples/FormGrid.tsx +16 -7
- package/src/components/Form/examples/FormGroupLabelInfo.tsx +15 -3
- package/src/components/Form/examples/FormHorizontal.tsx +10 -7
- package/src/components/Form/examples/FormHorizontalHelper.tsx +14 -21
- package/src/components/Form/examples/FormInvalid.tsx +11 -14
- package/src/components/Form/examples/FormInvalidWithFormAlert.tsx +20 -14
- package/src/components/Form/examples/FormLimitWidth.tsx +19 -3
- package/src/components/Form/examples/FormValidated.tsx +10 -12
- package/src/components/FormSelect/examples/FormSelectIconSpriteVariant.tsx +17 -11
- package/src/components/FormSelect/examples/FormSelectValidated.tsx +17 -11
- package/src/components/LoginPage/LoginForm.tsx +12 -15
- package/src/components/LoginPage/__tests__/__snapshots__/LoginForm.test.tsx.snap +0 -9
- package/src/components/Nav/examples/Nav.md +0 -5
- package/src/components/Page/Page.tsx +2 -2
- package/src/components/Page/__tests__/Page.test.tsx +1 -1
- package/src/components/Page/examples/Page.md +6 -13
- package/src/components/Page/index.ts +0 -4
- package/src/components/TextArea/examples/TextAreaValidated.tsx +9 -12
- package/src/components/Wizard/examples/WizardEnabledOnFormValidation.tsx +18 -9
- package/src/components/Wizard/examples/WizardValidateOnButtonPress.tsx +12 -9
- package/src/demos/Nav.md +37 -30
- package/src/demos/Page.md +0 -8
- package/src/demos/examples/HelperText/HelperTextDynamicVariantStaticText.tsx +2 -2
- package/src/demos/examples/HelperText/HelperTextStaticVariantDynamicText.tsx +1 -1
- package/src/demos/examples/HelperText/HelperTextStaticVariantStaticText.tsx +1 -1
- package/src/demos/examples/Page/PageStickySectionGroupUsingPageHeader.tsx +0 -267
- package/src/{components/Page → deprecated/components/PageHeader}/PageHeader.tsx +2 -2
- package/src/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsGroup.tsx +2 -2
- package/src/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsItem.tsx +2 -2
- package/src/deprecated/components/PageHeader/examples/PageHeader.md +15 -0
- package/src/{components/Page → deprecated/components/PageHeader}/examples/PageVerticalNavUsingPageHeaderComponent.tsx +4 -2
- package/src/deprecated/components/PageHeader/index.ts +4 -0
- package/src/{components/Page/__tests__ → deprecated/components/PageHeader/tests}/PageHeader.test.tsx +0 -2
- package/src/{components/Page/__tests__/Generated → deprecated/components/PageHeader/tests}/PageHeaderTools.test.tsx +2 -2
- package/src/{components/Page/__tests__/Generated → deprecated/components/PageHeader/tests}/PageHeaderToolsGroup.test.tsx +2 -2
- package/src/{components/Page/__tests__/Generated → deprecated/components/PageHeader/tests}/PageHeaderToolsItem.test.tsx +2 -2
- package/src/{components/Page/__tests__/Generated → deprecated/components/PageHeader/tests}/__snapshots__/PageHeaderToolsItem.test.tsx.snap +1 -0
- package/src/deprecated/components/index.ts +1 -0
- package/src/next/components/Wizard/examples/WizardEnabledOnFormValidation.tsx +9 -9
- package/src/next/components/Wizard/examples/WizardValidateOnButtonPress.tsx +12 -9
- package/dist/esm/components/Page/PageHeader.d.ts.map +0 -1
- package/dist/esm/components/Page/PageHeader.js.map +0 -1
- package/dist/esm/components/Page/PageHeaderTools.d.ts.map +0 -1
- package/dist/esm/components/Page/PageHeaderTools.js.map +0 -1
- package/dist/esm/components/Page/PageHeaderToolsGroup.d.ts.map +0 -1
- package/dist/esm/components/Page/PageHeaderToolsGroup.js.map +0 -1
- package/dist/esm/components/Page/PageHeaderToolsItem.d.ts.map +0 -1
- package/dist/esm/components/Page/PageHeaderToolsItem.js.map +0 -1
- package/dist/js/components/Page/PageHeader.d.ts.map +0 -1
- package/dist/js/components/Page/PageHeader.js.map +0 -1
- package/dist/js/components/Page/PageHeaderTools.d.ts.map +0 -1
- package/dist/js/components/Page/PageHeaderTools.js.map +0 -1
- package/dist/js/components/Page/PageHeaderToolsGroup.d.ts.map +0 -1
- package/dist/js/components/Page/PageHeaderToolsGroup.js.map +0 -1
- package/dist/js/components/Page/PageHeaderToolsItem.d.ts.map +0 -1
- package/dist/js/components/Page/PageHeaderToolsItem.js.map +0 -1
- package/src/components/Nav/examples/NavHorizontalPageHeader.tsx +0 -34
- /package/dist/esm/{components/Page → deprecated/components/PageHeader}/PageHeader.d.ts +0 -0
- /package/dist/esm/{components/Page → deprecated/components/PageHeader}/PageHeaderTools.d.ts +0 -0
- /package/dist/esm/{components/Page → deprecated/components/PageHeader}/PageHeaderTools.js +0 -0
- /package/dist/esm/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsGroup.d.ts +0 -0
- /package/dist/esm/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsItem.d.ts +0 -0
- /package/dist/js/{components/Page → deprecated/components/PageHeader}/PageHeader.d.ts +0 -0
- /package/dist/js/{components/Page → deprecated/components/PageHeader}/PageHeaderTools.d.ts +0 -0
- /package/dist/js/{components/Page → deprecated/components/PageHeader}/PageHeaderTools.js +0 -0
- /package/dist/js/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsGroup.d.ts +0 -0
- /package/dist/js/{components/Page → deprecated/components/PageHeader}/PageHeaderToolsItem.d.ts +0 -0
- /package/src/{components/Page → deprecated/components/PageHeader}/PageHeaderTools.tsx +0 -0
- /package/src/{components/Page/__tests__ → deprecated/components/PageHeader/tests}/__snapshots__/PageHeader.test.tsx.snap +0 -0
- /package/src/{components/Page/__tests__/Generated → deprecated/components/PageHeader/tests}/__snapshots__/PageHeaderTools.test.tsx.snap +0 -0
- /package/src/{components/Page/__tests__/Generated → deprecated/components/PageHeader/tests}/__snapshots__/PageHeaderToolsGroup.test.tsx.snap +0 -0
|
@@ -37,11 +37,6 @@ The following example shows two navigation groups, each with a `title` prop pass
|
|
|
37
37
|
```ts file="./NavMixed.tsx"
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
### Horizontal (only in PageHeader)
|
|
41
|
-
|
|
42
|
-
```ts file="./NavHorizontalPageHeader.tsx"
|
|
43
|
-
```
|
|
44
|
-
|
|
45
40
|
### Horizontal subnav
|
|
46
41
|
|
|
47
42
|
```ts file="./NavHorizontalSubNav.tsx"
|
|
@@ -19,7 +19,7 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
/** Additional classes added to the page layout */
|
|
21
21
|
className?: string;
|
|
22
|
-
/** Header component (e.g. <
|
|
22
|
+
/** Header component (e.g. <Masthead />) */
|
|
23
23
|
header?: React.ReactNode;
|
|
24
24
|
/** Sidebar component for a side nav (e.g. <PageSidebar />) */
|
|
25
25
|
sidebar?: React.ReactNode;
|
|
@@ -41,7 +41,7 @@ export interface PageProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
41
41
|
mainTabIndex?: number | null;
|
|
42
42
|
/**
|
|
43
43
|
* If true, manages the sidebar open/close state and there is no need to pass the isNavOpen boolean into
|
|
44
|
-
* the sidebar component or add a callback onNavToggle function into the
|
|
44
|
+
* the sidebar component or add a callback onNavToggle function into the Masthead component
|
|
45
45
|
*/
|
|
46
46
|
isManagedSidebar?: boolean;
|
|
47
47
|
/** Flag indicating if tertiary nav width should be limited */
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
4
|
|
|
5
5
|
import { Page } from '../Page';
|
|
6
|
-
import { PageHeader } from '
|
|
6
|
+
import { PageHeader } from '../../../deprecated/components/PageHeader';
|
|
7
7
|
import { PageSidebar } from '../PageSidebar';
|
|
8
8
|
import { PageSection } from '../PageSection';
|
|
9
9
|
import { Breadcrumb, BreadcrumbItem } from '../../Breadcrumb';
|
|
@@ -5,20 +5,20 @@ cssPrefix: pf-c-page
|
|
|
5
5
|
propComponents:
|
|
6
6
|
[
|
|
7
7
|
'Page',
|
|
8
|
-
'PageHeader',
|
|
9
|
-
'PageHeaderTools',
|
|
10
|
-
'PageHeaderToolsGroup',
|
|
11
|
-
'PageHeaderToolsItem',
|
|
12
8
|
'PageSidebar',
|
|
13
9
|
'PageSection',
|
|
14
10
|
'PageGroup',
|
|
15
11
|
'PageBreadcrumb',
|
|
16
12
|
'PageNavigation',
|
|
17
|
-
'PageToggleButton'
|
|
13
|
+
'PageToggleButton'
|
|
18
14
|
]
|
|
19
15
|
---
|
|
20
16
|
|
|
21
17
|
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
18
|
+
import {
|
|
19
|
+
PageHeader,
|
|
20
|
+
PageHeaderTools
|
|
21
|
+
} from '@patternfly/react-core/deprecated';
|
|
22
22
|
import './page.css';
|
|
23
23
|
|
|
24
24
|
## Examples
|
|
@@ -41,13 +41,6 @@ The `isNavOpen` property helps facilitate the opening and closing of the sidebar
|
|
|
41
41
|
```ts file="./PageVerticalNav.tsx"
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
### Legacy page header
|
|
45
|
-
|
|
46
|
-
This example shows the legacy implementation of a page's vertical navigation. Our updated recommendation advises you to use a masthead and toolbar to make headers, rather than `<PageHeader>` and `<PageHeaderTools>` as shown in the following example.
|
|
47
|
-
|
|
48
|
-
```ts file="./PageVerticalNavUsingPageHeaderComponent.tsx"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
44
|
### Horizontal navigation
|
|
52
45
|
|
|
53
46
|
To add horizontal navigation to the top of a `<Page>`, add the navigation inside of a `<ToolbarItem>` in the `<Toolbar>` that is passed to the `<MastheadContent>` of the `<Masthead>`.
|
|
@@ -66,7 +59,7 @@ Tertiary navigation allows you to add an additional navigation menu alongside ve
|
|
|
66
59
|
|
|
67
60
|
### Uncontrolled navigation
|
|
68
61
|
|
|
69
|
-
When the `isManagedSidebar` property is true, it manages the sidebar open/close state, removing the need to pass both `isNavOpen` into the `<PageSidebar>` and `onNavToggle` into the `<
|
|
62
|
+
When the `isManagedSidebar` property is true, it manages the sidebar open/close state, removing the need to pass both `isNavOpen` into the `<PageSidebar>` and `onNavToggle` into the `<PageToggleButton>`.
|
|
70
63
|
|
|
71
64
|
```ts file="./PageUncontrolledNav.tsx"
|
|
72
65
|
```
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
export * from './Page';
|
|
2
2
|
export * from './PageBreadcrumb';
|
|
3
3
|
export * from './PageGroup';
|
|
4
|
-
export * from './PageHeader';
|
|
5
4
|
export * from './PageSidebar';
|
|
6
5
|
export * from './PageSection';
|
|
7
|
-
export * from './PageHeaderTools';
|
|
8
|
-
export * from './PageHeaderToolsGroup';
|
|
9
|
-
export * from './PageHeaderToolsItem';
|
|
10
6
|
export * from './PageNavigation';
|
|
11
7
|
export * from './PageToggleButton';
|
|
12
8
|
export * from './PageContext';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Form, FormGroup, TextArea } from '@patternfly/react-core';
|
|
2
|
+
import { Form, FormGroup, FormHelperText, HelperText, HelperTextItem, TextArea } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const TextAreaValidated: React.FunctionComponent = () => {
|
|
5
5
|
const [value, setValue] = React.useState('');
|
|
6
|
-
const [invalidText, setInvalidText] = React.useState('You must have something to say');
|
|
7
6
|
const [validated, setValidated] = React.useState<'default' | 'error' | 'warning' | 'success' | undefined>('default');
|
|
8
7
|
const [helperText, setHelperText] = React.useState('Share your thoughts.');
|
|
9
8
|
const simulateNetworkCall = (callback: Function) => {
|
|
@@ -21,7 +20,7 @@ export const TextAreaValidated: React.FunctionComponent = () => {
|
|
|
21
20
|
setHelperText('Thanks for your comments!');
|
|
22
21
|
} else {
|
|
23
22
|
setValidated('error');
|
|
24
|
-
|
|
23
|
+
setHelperText("You're being too brief, please enter at least 10 characters.");
|
|
25
24
|
}
|
|
26
25
|
} else {
|
|
27
26
|
setValidated('warning');
|
|
@@ -31,21 +30,19 @@ export const TextAreaValidated: React.FunctionComponent = () => {
|
|
|
31
30
|
};
|
|
32
31
|
return (
|
|
33
32
|
<Form>
|
|
34
|
-
<FormGroup
|
|
35
|
-
label="Comments:"
|
|
36
|
-
type="string"
|
|
37
|
-
helperText={helperText}
|
|
38
|
-
helperTextInvalid={invalidText}
|
|
39
|
-
fieldId="selection"
|
|
40
|
-
validated={validated}
|
|
41
|
-
>
|
|
33
|
+
<FormGroup label="Comments:" type="string" fieldId="selection">
|
|
42
34
|
<TextArea
|
|
43
35
|
value={value}
|
|
44
|
-
onChange={value => handleTextAreaChange(value)}
|
|
36
|
+
onChange={(value) => handleTextAreaChange(value)}
|
|
45
37
|
isRequired
|
|
46
38
|
validated={validated}
|
|
47
39
|
aria-label="invalid text area example"
|
|
48
40
|
/>
|
|
41
|
+
<FormHelperText>
|
|
42
|
+
<HelperText>
|
|
43
|
+
<HelperTextItem variant={validated}>{helperText}</HelperTextItem>
|
|
44
|
+
</HelperText>
|
|
45
|
+
</FormHelperText>
|
|
49
46
|
</FormGroup>
|
|
50
47
|
</Form>
|
|
51
48
|
);
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Form,
|
|
4
|
+
FormGroup,
|
|
5
|
+
FormHelperText,
|
|
6
|
+
HelperText,
|
|
7
|
+
HelperTextItem,
|
|
8
|
+
TextInput,
|
|
9
|
+
Wizard,
|
|
10
|
+
WizardStep
|
|
11
|
+
} from '@patternfly/react-core';
|
|
3
12
|
interface PrevStepInfo {
|
|
4
13
|
prevId?: string | number;
|
|
5
14
|
prevName: React.ReactNode;
|
|
@@ -26,14 +35,7 @@ const SampleForm: React.FunctionComponent<sampleFormProps> = (props: sampleFormP
|
|
|
26
35
|
|
|
27
36
|
return (
|
|
28
37
|
<Form>
|
|
29
|
-
<FormGroup
|
|
30
|
-
label="Age:"
|
|
31
|
-
type="number"
|
|
32
|
-
helperText="Write your age in numbers."
|
|
33
|
-
helperTextInvalid="Age has to be a number"
|
|
34
|
-
fieldId="age"
|
|
35
|
-
validated={validated}
|
|
36
|
-
>
|
|
38
|
+
<FormGroup label="Age:" type="number" fieldId="age">
|
|
37
39
|
<TextInput
|
|
38
40
|
validated={validated}
|
|
39
41
|
value={value}
|
|
@@ -41,6 +43,13 @@ const SampleForm: React.FunctionComponent<sampleFormProps> = (props: sampleFormP
|
|
|
41
43
|
aria-describedby="age-helper"
|
|
42
44
|
onChange={handleTextInputChange}
|
|
43
45
|
/>
|
|
46
|
+
<FormHelperText>
|
|
47
|
+
<HelperText>
|
|
48
|
+
<HelperTextItem variant={validated}>
|
|
49
|
+
{validated === 'error' ? 'Age has to be a number' : 'Write your age in numbers.'}
|
|
50
|
+
</HelperTextItem>
|
|
51
|
+
</HelperText>
|
|
52
|
+
</FormHelperText>
|
|
44
53
|
</FormGroup>
|
|
45
54
|
</Form>
|
|
46
55
|
);
|
|
@@ -14,7 +14,10 @@ import {
|
|
|
14
14
|
WizardFooter,
|
|
15
15
|
WizardContextConsumer,
|
|
16
16
|
Alert,
|
|
17
|
-
EmptyStateIcon
|
|
17
|
+
EmptyStateIcon,
|
|
18
|
+
HelperText,
|
|
19
|
+
HelperTextItem,
|
|
20
|
+
FormHelperText
|
|
18
21
|
} from '@patternfly/react-core';
|
|
19
22
|
// eslint-disable-next-line patternfly-react/import-tokens-icons
|
|
20
23
|
import { CogsIcon } from '@patternfly/react-icons';
|
|
@@ -94,14 +97,7 @@ const SampleForm: React.FunctionComponent<sampleFormProps> = (props: sampleFormP
|
|
|
94
97
|
|
|
95
98
|
return (
|
|
96
99
|
<Form>
|
|
97
|
-
<FormGroup
|
|
98
|
-
label="Age:"
|
|
99
|
-
type="number"
|
|
100
|
-
helperText="Write your age in numbers."
|
|
101
|
-
helperTextInvalid="Age has to be a number"
|
|
102
|
-
fieldId="age"
|
|
103
|
-
validated={validated}
|
|
104
|
-
>
|
|
100
|
+
<FormGroup label="Age:" type="number" fieldId="age">
|
|
105
101
|
<TextInput
|
|
106
102
|
validated={validated}
|
|
107
103
|
value={value}
|
|
@@ -109,6 +105,13 @@ const SampleForm: React.FunctionComponent<sampleFormProps> = (props: sampleFormP
|
|
|
109
105
|
aria-describedby="age-helper"
|
|
110
106
|
onChange={handleTextInputChange}
|
|
111
107
|
/>
|
|
108
|
+
<FormHelperText>
|
|
109
|
+
<HelperText>
|
|
110
|
+
<HelperTextItem variant={validated}>
|
|
111
|
+
{validated === 'error' ? 'Age has to be a number' : 'Write your age in numbers.'}
|
|
112
|
+
</HelperTextItem>
|
|
113
|
+
</HelperText>
|
|
114
|
+
</FormHelperText>
|
|
112
115
|
</FormGroup>
|
|
113
116
|
</Form>
|
|
114
117
|
);
|
package/src/demos/Nav.md
CHANGED
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
id: Navigation
|
|
3
3
|
section: components
|
|
4
4
|
---
|
|
5
|
-
|
|
6
5
|
import {
|
|
7
|
-
Dropdown as DropdownDeprecated,
|
|
8
|
-
DropdownGroup as DropdownGroupDeprecated,
|
|
9
|
-
DropdownToggle,
|
|
10
|
-
DropdownItem as DropdownItemDeprecated,
|
|
11
|
-
KebabToggle
|
|
6
|
+
Dropdown as DropdownDeprecated,
|
|
7
|
+
DropdownGroup as DropdownGroupDeprecated,
|
|
8
|
+
DropdownToggle,
|
|
9
|
+
DropdownItem as DropdownItemDeprecated,
|
|
10
|
+
KebabToggle,
|
|
11
|
+
PageHeader,
|
|
12
|
+
PageHeaderTools,
|
|
13
|
+
PageHeaderToolsGroup,
|
|
14
|
+
PageHeaderToolsItem
|
|
12
15
|
} from '@patternfly/react-core/deprecated';
|
|
16
|
+
|
|
13
17
|
import { DashboardBreadcrumb } from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
|
|
14
18
|
import DashboardHeader from '@patternfly/react-core/src/demos/examples/DashboardHeader';
|
|
15
19
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
@@ -372,17 +376,18 @@ import {
|
|
|
372
376
|
NavItem,
|
|
373
377
|
NavList,
|
|
374
378
|
Page,
|
|
375
|
-
PageHeader,
|
|
376
379
|
PageSection,
|
|
377
380
|
PageSectionVariants,
|
|
378
381
|
SkipToContent,
|
|
379
382
|
TextContent,
|
|
380
|
-
Text
|
|
381
|
-
PageHeaderTools,
|
|
382
|
-
PageHeaderToolsGroup,
|
|
383
|
-
PageHeaderToolsItem
|
|
383
|
+
Text
|
|
384
384
|
} from '@patternfly/react-core';
|
|
385
|
+
|
|
385
386
|
import {
|
|
387
|
+
PageHeader,
|
|
388
|
+
PageHeaderTools,
|
|
389
|
+
PageHeaderToolsGroup,
|
|
390
|
+
PageHeaderToolsItem,
|
|
386
391
|
Dropdown as DropdownDeprecated,
|
|
387
392
|
DropdownGroup as DropdownGroupDeprecated,
|
|
388
393
|
DropdownToggle,
|
|
@@ -730,23 +735,23 @@ import {
|
|
|
730
735
|
NavItem,
|
|
731
736
|
NavList,
|
|
732
737
|
Page,
|
|
733
|
-
PageHeader,
|
|
734
738
|
PageSection,
|
|
735
739
|
PageSectionVariants,
|
|
736
740
|
PageSectionTypes,
|
|
737
741
|
SkipToContent,
|
|
738
742
|
TextContent,
|
|
739
|
-
Text
|
|
740
|
-
PageHeaderTools,
|
|
741
|
-
PageHeaderToolsGroup,
|
|
742
|
-
PageHeaderToolsItem
|
|
743
|
+
Text
|
|
743
744
|
} from '@patternfly/react-core';
|
|
744
745
|
import {
|
|
745
746
|
Dropdown as DropdownDeprecated,
|
|
746
747
|
DropdownGroup as DropdownGroupDeprecated,
|
|
747
748
|
DropdownToggle,
|
|
748
749
|
DropdownItem as DropdownItemDeprecated,
|
|
749
|
-
KebabToggle
|
|
750
|
+
KebabToggle,
|
|
751
|
+
PageHeader,
|
|
752
|
+
PageHeaderTools,
|
|
753
|
+
PageHeaderToolsItem,
|
|
754
|
+
PageHeaderToolsGroup
|
|
750
755
|
} from '@patternfly/react-core/deprecated';
|
|
751
756
|
import { DashboardBreadcrumb } from '@patternfly/react-core/src/demos/examples/DashboardWrapper';
|
|
752
757
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
@@ -1196,23 +1201,23 @@ import {
|
|
|
1196
1201
|
NavItem,
|
|
1197
1202
|
NavList,
|
|
1198
1203
|
Page,
|
|
1199
|
-
PageHeader,
|
|
1200
1204
|
PageSection,
|
|
1201
1205
|
PageSectionVariants,
|
|
1202
1206
|
PageSidebar,
|
|
1203
1207
|
SkipToContent,
|
|
1204
1208
|
TextContent,
|
|
1205
|
-
Text
|
|
1206
|
-
PageHeaderTools,
|
|
1207
|
-
PageHeaderToolsGroup,
|
|
1208
|
-
PageHeaderToolsItem
|
|
1209
|
+
Text
|
|
1209
1210
|
} from '@patternfly/react-core';
|
|
1210
1211
|
import {
|
|
1211
1212
|
Dropdown as DropdownDeprecated,
|
|
1212
1213
|
DropdownGroup as DropdownGroupDeprecated,
|
|
1213
1214
|
DropdownToggle,
|
|
1214
1215
|
DropdownItem as DropdownItemDeprecated,
|
|
1215
|
-
KebabToggle
|
|
1216
|
+
KebabToggle,
|
|
1217
|
+
PageHeader,
|
|
1218
|
+
PageHeaderTools,
|
|
1219
|
+
PageHeaderToolsItem,
|
|
1220
|
+
PageHeaderToolsGroup
|
|
1216
1221
|
} from '@patternfly/react-core/deprecated';
|
|
1217
1222
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
1218
1223
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
@@ -1433,8 +1438,6 @@ import {
|
|
|
1433
1438
|
Nav,
|
|
1434
1439
|
NavList,
|
|
1435
1440
|
NavItem,
|
|
1436
|
-
PageHeader,
|
|
1437
|
-
PageHeaderTools,
|
|
1438
1441
|
PageSidebar,
|
|
1439
1442
|
PageSection,
|
|
1440
1443
|
PageSectionVariants,
|
|
@@ -1443,6 +1446,10 @@ import {
|
|
|
1443
1446
|
MenuList,
|
|
1444
1447
|
MenuItem
|
|
1445
1448
|
} from '@patternfly/react-core';
|
|
1449
|
+
import {
|
|
1450
|
+
PageHeader,
|
|
1451
|
+
PageHeaderTools,
|
|
1452
|
+
}from '@patternfly/react-core';
|
|
1446
1453
|
import DashboardHeader from '@patternfly/react-core/src/demos/examples/DashboardHeader';
|
|
1447
1454
|
|
|
1448
1455
|
class VerticalPage extends React.Component {
|
|
@@ -1452,7 +1459,7 @@ class VerticalPage extends React.Component {
|
|
|
1452
1459
|
isNavOpen: true,
|
|
1453
1460
|
activeItem: 0
|
|
1454
1461
|
};
|
|
1455
|
-
this.onNavSelect = (result) => {
|
|
1462
|
+
this.onNavSelect = (e, result) => {
|
|
1456
1463
|
this.setState({
|
|
1457
1464
|
activeItem: result.itemId
|
|
1458
1465
|
});
|
|
@@ -1493,17 +1500,17 @@ class VerticalPage extends React.Component {
|
|
|
1493
1500
|
const { activeItem } = this.state;
|
|
1494
1501
|
|
|
1495
1502
|
const Sidebar = (
|
|
1496
|
-
<PageSidebar
|
|
1503
|
+
<PageSidebar style={{"overflow": "visible"}}
|
|
1497
1504
|
nav={
|
|
1498
1505
|
<Nav onSelect={this.onNavSelect}>
|
|
1499
1506
|
<NavList>
|
|
1500
|
-
<NavItem id="flyout-link1" to="#flyout-link1" itemId={0} isActive={activeItem === 0}>
|
|
1507
|
+
<NavItem preventDefault id="flyout-link1" to="#flyout-link1" itemId={0} isActive={activeItem === 0}>
|
|
1501
1508
|
System Panel
|
|
1502
1509
|
</NavItem>
|
|
1503
|
-
<NavItem flyout={curFlyout} id="flyout-link2"
|
|
1510
|
+
<NavItem preventDefault flyout={curFlyout} id="flyout-link2" itemId={1} isActive={activeItem === 1}>
|
|
1504
1511
|
Settings
|
|
1505
1512
|
</NavItem>
|
|
1506
|
-
<NavItem id="flyout-link3" to="#flyout-link3" itemId={2} isActive={activeItem === 2}>
|
|
1513
|
+
<NavItem preventDefault id="flyout-link3" to="#flyout-link3" itemId={2} isActive={activeItem === 2}>
|
|
1507
1514
|
Authentication
|
|
1508
1515
|
</NavItem>
|
|
1509
1516
|
</NavList>
|
package/src/demos/Page.md
CHANGED
|
@@ -43,14 +43,6 @@ This demonstrates a variety of navigation patterns in the context of a full page
|
|
|
43
43
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
### Sticky section group (using PageHeader)
|
|
47
|
-
|
|
48
|
-
This demo is provided becuase PageHeader and PageHeaderTools are still in use; however, going forward Masthead and Toolbar should be used to make headers rather than PageHeader and PageHeaderTools.
|
|
49
|
-
|
|
50
|
-
```ts file='./examples/Page/PageStickySectionGroupUsingPageHeader.tsx' isFullscreen
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
|
|
54
46
|
### Sticky section breadcrumb (with breakpoints)
|
|
55
47
|
|
|
56
48
|
```ts file='./examples/Page/PageStickySectionBreadcrumb.tsx' isFullscreen
|
|
@@ -40,7 +40,7 @@ export const HelperTextDynamicVariantDynamicText: React.FunctionComponent = () =
|
|
|
40
40
|
setValue(inputValue);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
const filterValidations = () => Object.keys(inputValidation).filter(item => inputValidation[item] !== 'success');
|
|
43
|
+
const filterValidations = () => Object.keys(inputValidation).filter((item) => inputValidation[item] !== 'success');
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
46
|
<Form>
|
|
@@ -55,7 +55,7 @@ export const HelperTextDynamicVariantDynamicText: React.FunctionComponent = () =
|
|
|
55
55
|
aria-invalid={ruleCharacterTypes === 'error' || ruleLength === 'error'}
|
|
56
56
|
value={value}
|
|
57
57
|
/>
|
|
58
|
-
<FormHelperText
|
|
58
|
+
<FormHelperText>
|
|
59
59
|
<HelperText component="ul">
|
|
60
60
|
<HelperTextItem component="li" id="ruleLength" isDynamic variant={ruleLength as any}>
|
|
61
61
|
Must be at least 5 characters in length
|
|
@@ -32,7 +32,7 @@ export const HelperTextStaticVariantDynamicText: React.FunctionComponent = () =>
|
|
|
32
32
|
aria-invalid={inputValidation === 'error'}
|
|
33
33
|
value={value}
|
|
34
34
|
/>
|
|
35
|
-
<FormHelperText
|
|
35
|
+
<FormHelperText>
|
|
36
36
|
<HelperText id="helper-text2" aria-live="polite">
|
|
37
37
|
{inputValidation !== 'success' && (
|
|
38
38
|
<HelperTextItem variant={inputValidation as any} hasIcon={inputValidation === 'error'}>
|
|
@@ -19,7 +19,7 @@ export const HelperTextStaticVariantStaticText: React.FunctionComponent = () =>
|
|
|
19
19
|
aria-describedby="helper-text1"
|
|
20
20
|
value={value}
|
|
21
21
|
/>
|
|
22
|
-
<FormHelperText
|
|
22
|
+
<FormHelperText>
|
|
23
23
|
<HelperText id="helper-text1">
|
|
24
24
|
<HelperTextItem variant={'default'}>Enter your middle name or your middle initial</HelperTextItem>
|
|
25
25
|
</HelperText>
|