@patternfly/react-core 4.204.0 → 4.206.0
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 +30 -0
- package/dist/esm/components/HelperText/HelperText.d.ts +9 -0
- package/dist/esm/components/HelperText/HelperText.d.ts.map +1 -1
- package/dist/esm/components/HelperText/HelperText.js +2 -2
- package/dist/esm/components/HelperText/HelperText.js.map +1 -1
- package/dist/esm/components/HelperText/HelperTextItem.d.ts +9 -1
- package/dist/esm/components/HelperText/HelperTextItem.d.ts.map +1 -1
- package/dist/esm/components/HelperText/HelperTextItem.js +2 -2
- package/dist/esm/components/HelperText/HelperTextItem.js.map +1 -1
- package/dist/js/components/HelperText/HelperText.d.ts +9 -0
- package/dist/js/components/HelperText/HelperText.d.ts.map +1 -1
- package/dist/js/components/HelperText/HelperText.js +2 -2
- package/dist/js/components/HelperText/HelperText.js.map +1 -1
- package/dist/js/components/HelperText/HelperTextItem.d.ts +9 -1
- package/dist/js/components/HelperText/HelperTextItem.d.ts.map +1 -1
- package/dist/js/components/HelperText/HelperTextItem.js +2 -2
- package/dist/js/components/HelperText/HelperTextItem.js.map +1 -1
- package/dist/umd/react-core.css +174 -12
- package/dist/umd/react-core.js +17 -5
- package/dist/umd/react-core.min.css +174 -12
- package/dist/umd/react-core.min.js +3 -3
- package/package.json +6 -6
- package/src/components/HelperText/HelperText.tsx +17 -1
- package/src/components/HelperText/HelperTextItem.tsx +11 -1
- package/src/demos/HelperText.md +48 -0
- package/src/demos/Tabs.md +6 -1
- package/src/demos/examples/DashboardWrapper.js +16 -2
- package/src/demos/examples/HelperText/HelperTextDynamicVariantStaticText.tsx +71 -0
- package/src/demos/examples/HelperText/HelperTextStaticVariantDynamicText.tsx +47 -0
- package/src/demos/examples/HelperText/HelperTextStaticVariantStaticText.tsx +30 -0
- package/src/demos/examples/Tabs/GrayTabs.tsx +2 -8
- package/src/demos/examples/Tabs/ModalTabs.tsx +1 -1
- package/src/demos/{Tabs/NestedTabsDemo.js → examples/Tabs/NestedTabs.tsx} +12 -13
- package/src/demos/examples/Tabs/NestedUnindentedTabs.tsx +174 -0
- package/src/demos/examples/Tabs/TabsAndTable.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.206.0",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.
|
|
38
|
-
"@patternfly/react-styles": "^4.
|
|
39
|
-
"@patternfly/react-tokens": "^4.
|
|
37
|
+
"@patternfly/react-icons": "^4.57.0",
|
|
38
|
+
"@patternfly/react-styles": "^4.56.0",
|
|
39
|
+
"@patternfly/react-tokens": "^4.58.0",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
43
43
|
"tslib": "^2.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@patternfly/patternfly": "4.
|
|
46
|
+
"@patternfly/patternfly": "4.192.0",
|
|
47
47
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
48
48
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
49
49
|
"@rollup/plugin-replace": "^3.0.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "b29e37a88fa7fee5dde681b95a45957e348711fd"
|
|
64
64
|
}
|
|
@@ -9,17 +9,33 @@ export interface HelperTextProps extends React.HTMLProps<HTMLDivElement | HTMLUL
|
|
|
9
9
|
className?: string;
|
|
10
10
|
/** Component type of the helper text container */
|
|
11
11
|
component?: 'div' | 'ul';
|
|
12
|
+
/** ID for the helper text container. The value of this prop can be passed into a form component's
|
|
13
|
+
* aria-describedby prop when you intend for all helper text items to be announced to
|
|
14
|
+
* assistive technologies.
|
|
15
|
+
*/
|
|
16
|
+
id?: string;
|
|
17
|
+
/** Flag for indicating whether the helper text container is a live region. Use this prop when you
|
|
18
|
+
* expect or intend for any helper text items within the container to be dynamically updated.
|
|
19
|
+
*/
|
|
20
|
+
isLiveRegion?: boolean;
|
|
12
21
|
}
|
|
13
22
|
|
|
14
23
|
export const HelperText: React.FunctionComponent<HelperTextProps> = ({
|
|
15
24
|
children,
|
|
16
25
|
className,
|
|
17
26
|
component = 'div',
|
|
27
|
+
id,
|
|
28
|
+
isLiveRegion = false,
|
|
18
29
|
...props
|
|
19
30
|
}: HelperTextProps) => {
|
|
20
31
|
const Component = component as any;
|
|
21
32
|
return (
|
|
22
|
-
<Component
|
|
33
|
+
<Component
|
|
34
|
+
id={id}
|
|
35
|
+
className={css(styles.helperText, className)}
|
|
36
|
+
{...(isLiveRegion && { 'aria-live': 'polite' })}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
23
39
|
{children}
|
|
24
40
|
</Component>
|
|
25
41
|
);
|
|
@@ -17,10 +17,18 @@ export interface HelperTextItemProps extends React.HTMLProps<HTMLDivElement | HT
|
|
|
17
17
|
variant?: 'default' | 'indeterminate' | 'warning' | 'success' | 'error';
|
|
18
18
|
/** Custom icon prefixing the helper text. This property will override the default icon paired with each helper text variant. */
|
|
19
19
|
icon?: React.ReactNode;
|
|
20
|
-
/** Flag indicating the helper text item is dynamic.
|
|
20
|
+
/** Flag indicating the helper text item is dynamic. This prop should be used when the
|
|
21
|
+
* text content of the helper text item will never change, but the icon and styling will
|
|
22
|
+
* be dynamically updated via the `variant` prop.
|
|
23
|
+
*/
|
|
21
24
|
isDynamic?: boolean;
|
|
22
25
|
/** Flag indicating the helper text should have an icon. Dynamic helper texts include icons by default while static helper texts do not. */
|
|
23
26
|
hasIcon?: boolean;
|
|
27
|
+
/** ID for the helper text item. The value of this prop can be passed into a form component's
|
|
28
|
+
* aria-describedby prop when you intend for only specific helper text items to be announced to
|
|
29
|
+
* assistive technologies.
|
|
30
|
+
*/
|
|
31
|
+
id?: string;
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
const variantStyle = {
|
|
@@ -39,12 +47,14 @@ export const HelperTextItem: React.FunctionComponent<HelperTextItemProps> = ({
|
|
|
39
47
|
icon,
|
|
40
48
|
isDynamic = false,
|
|
41
49
|
hasIcon = isDynamic,
|
|
50
|
+
id,
|
|
42
51
|
...props
|
|
43
52
|
}: HelperTextItemProps) => {
|
|
44
53
|
const Component = component as any;
|
|
45
54
|
return (
|
|
46
55
|
<Component
|
|
47
56
|
className={css(styles.helperTextItem, variantStyle[variant], isDynamic && styles.modifiers.dynamic, className)}
|
|
57
|
+
id={id}
|
|
48
58
|
{...props}
|
|
49
59
|
>
|
|
50
60
|
{icon && (
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: Helper text
|
|
3
|
+
section: components
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import MinusIcon from '@patternfly/react-icons/dist/esm/icons/minus-icon';
|
|
7
|
+
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';
|
|
8
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
9
|
+
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
10
|
+
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
11
|
+
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
12
|
+
|
|
13
|
+
## Demos
|
|
14
|
+
|
|
15
|
+
### Static variant with static text
|
|
16
|
+
|
|
17
|
+
In this demo, the static variant of the helper text item component (the default) is used, and the text itself will always be visible to users and will never change.
|
|
18
|
+
|
|
19
|
+
The `aria-describedby` attribute is passed into the text input component and is linked to the `id` of the helper text component. This allows assistive technologies to notify users of the helper text content when the input receives focus, which can be helpful if a user navigates away from and then back to the input.
|
|
20
|
+
|
|
21
|
+
Note that this demo does not validate the text input component. When it would need to be validated, there are other steps that would need to be taken to make it accessible, such as passing in `aria-invalid` and `aria-live` attributes to the appropriate components.
|
|
22
|
+
|
|
23
|
+
```ts file='./examples/HelperText/HelperTextStaticVariantStaticText.tsx'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Static variant with dynamic text
|
|
27
|
+
|
|
28
|
+
In this demo, the static variant of the helper text item component (the default) is used with the `hasIcon` prop passed in when there is an error, and the text itself dynamically updates based on the input value. When the input has a value of `johndoe`, an error is rendered to simulate a username already being taken, while an empty input renders other helper text. When the input is valid, no helper text is rendered.
|
|
29
|
+
|
|
30
|
+
The `aria-describedby` attribute is passed into the text input component and is linked to the `id` of the helper text component. Similar to the static variant with static text demo, this allows assistive technologies to notify users of the helper text content when the navigating to the input.
|
|
31
|
+
|
|
32
|
+
An `aria-live` region is passed into the helper text component, which allows assistive technologies to announce to users when any dynamic content within it updates, such as when the text content changes or gets rendered. Without this attribute, a user would have to navigate out of and back into the input field multiple times to check the status of their input.
|
|
33
|
+
|
|
34
|
+
The `aria-invalid` attribute is also passed into the text input, which allows assistive technologies to notify users that an input is invalid. When this attribute is true, it's important that users are notified of what is causing the input to be invalid; in this case, `aria-describedby` and `aria-live` help accomplish this.
|
|
35
|
+
|
|
36
|
+
```ts file='./examples/HelperText/HelperTextStaticVariantDynamicText.tsx'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Dynamic variant with static text
|
|
40
|
+
|
|
41
|
+
In this demo, the helper text item components have the `isDynamic` prop passed in. While the text content of the components is static, the icons and styling will change as the validation of the input changes.
|
|
42
|
+
|
|
43
|
+
The `aria-describedby` attribute is passed into the text input component and is linked to the id attribute of a helper text item that results in an invalid input. This will allow assistive technologies to only be notified of any outstanding criteria that has not been met when the input receives focus.
|
|
44
|
+
|
|
45
|
+
Similar to the static variant with dynamic text example, the `aria-invalid` attribute is passed in, allowing assistive technologies to announce to users when at least 1 item is causing the input to be invalid.
|
|
46
|
+
|
|
47
|
+
```ts file='./examples/HelperText/HelperTextDynamicVariantStaticText.tsx'
|
|
48
|
+
```
|
package/src/demos/Tabs.md
CHANGED
|
@@ -445,7 +445,12 @@ TabsOpenWithSecondaryTabsDemo = () => {
|
|
|
445
445
|
|
|
446
446
|
### Nested tabs
|
|
447
447
|
|
|
448
|
-
```js isFullscreen file="./Tabs/
|
|
448
|
+
```js isFullscreen file="./examples/Tabs/NestedTabs.tsx"
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Nested, unindented tabs
|
|
452
|
+
|
|
453
|
+
```js isFullscreen file="./examples/Tabs/NestedUnindentedTabs.tsx"
|
|
449
454
|
```
|
|
450
455
|
|
|
451
456
|
### Tables and tabs
|
|
@@ -6,8 +6,11 @@ import {
|
|
|
6
6
|
NavItem,
|
|
7
7
|
NavList,
|
|
8
8
|
Page,
|
|
9
|
+
PageSection,
|
|
9
10
|
PageSidebar,
|
|
10
|
-
SkipToContent
|
|
11
|
+
SkipToContent,
|
|
12
|
+
Text,
|
|
13
|
+
TextContent
|
|
11
14
|
} from '@patternfly/react-core';
|
|
12
15
|
import DashboardHeader from './DashboardHeader';
|
|
13
16
|
|
|
@@ -21,6 +24,15 @@ export const DashboardBreadcrumb = (
|
|
|
21
24
|
</BreadcrumbItem>
|
|
22
25
|
</Breadcrumb>
|
|
23
26
|
);
|
|
27
|
+
|
|
28
|
+
export const PageTemplateTitle = (
|
|
29
|
+
<PageSection variant="light">
|
|
30
|
+
<TextContent>
|
|
31
|
+
<Text component="h1">Main title</Text>
|
|
32
|
+
<Text component="p">This is a full page demo.</Text>
|
|
33
|
+
</TextContent>
|
|
34
|
+
</PageSection>
|
|
35
|
+
);
|
|
24
36
|
export default class DashboardWrapper extends React.Component {
|
|
25
37
|
constructor(props) {
|
|
26
38
|
super(props);
|
|
@@ -45,7 +57,8 @@ export default class DashboardWrapper extends React.Component {
|
|
|
45
57
|
sidebar,
|
|
46
58
|
sidebarNavOpen,
|
|
47
59
|
onPageResize,
|
|
48
|
-
hasNoBreadcrumb
|
|
60
|
+
hasNoBreadcrumb,
|
|
61
|
+
hasPageTemplateTitle
|
|
49
62
|
} = this.props;
|
|
50
63
|
|
|
51
64
|
let renderedBreadcrumb;
|
|
@@ -92,6 +105,7 @@ export default class DashboardWrapper extends React.Component {
|
|
|
92
105
|
mainContainerId={mainContainerId ? mainContainerId : 'main-content-page-layout-default-nav'}
|
|
93
106
|
onPageResize={onPageResize}
|
|
94
107
|
>
|
|
108
|
+
{hasPageTemplateTitle && PageTemplateTitle}
|
|
95
109
|
{children}
|
|
96
110
|
</Page>
|
|
97
111
|
);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form, FormGroup, FormHelperText, TextInput, HelperText, HelperTextItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const HelperTextDynamicVariantDynamicText: React.FunctionComponent = () => {
|
|
5
|
+
const [value, setValue] = React.useState('');
|
|
6
|
+
const [inputValidation, setInputValidation] = React.useState({
|
|
7
|
+
ruleLength: 'indeterminate',
|
|
8
|
+
ruleCharacterTypes: 'indeterminate'
|
|
9
|
+
});
|
|
10
|
+
const { ruleLength, ruleCharacterTypes } = inputValidation;
|
|
11
|
+
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
let lengthStatus = ruleLength;
|
|
14
|
+
let typeStatus = ruleCharacterTypes;
|
|
15
|
+
|
|
16
|
+
if (value === '') {
|
|
17
|
+
setInputValidation({
|
|
18
|
+
ruleLength: 'indeterminate',
|
|
19
|
+
ruleCharacterTypes: 'indeterminate'
|
|
20
|
+
});
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!/\d/g.test(value)) {
|
|
25
|
+
typeStatus = 'error';
|
|
26
|
+
} else {
|
|
27
|
+
typeStatus = 'success';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (value.length < 5) {
|
|
31
|
+
lengthStatus = 'error';
|
|
32
|
+
} else {
|
|
33
|
+
lengthStatus = 'success';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
setInputValidation({ ruleLength: lengthStatus, ruleCharacterTypes: typeStatus });
|
|
37
|
+
}, [value, ruleLength, ruleCharacterTypes]);
|
|
38
|
+
|
|
39
|
+
const handleInputChange = (inputValue: string) => {
|
|
40
|
+
setValue(inputValue);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const filterValidations = () => Object.keys(inputValidation).filter(item => inputValidation[item] !== 'success');
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Form>
|
|
47
|
+
<FormGroup label="Username" isRequired fieldId="login-input-helper-text3">
|
|
48
|
+
<TextInput
|
|
49
|
+
isRequired
|
|
50
|
+
type="text"
|
|
51
|
+
id="login-input-helper-text3"
|
|
52
|
+
name="login-input-helper-text3"
|
|
53
|
+
onChange={handleInputChange}
|
|
54
|
+
aria-describedby={filterValidations().join(' ')}
|
|
55
|
+
aria-invalid={ruleCharacterTypes === 'error' || ruleLength === 'error'}
|
|
56
|
+
value={value}
|
|
57
|
+
/>
|
|
58
|
+
<FormHelperText isHidden={false} component="div">
|
|
59
|
+
<HelperText component="ul">
|
|
60
|
+
<HelperTextItem component="li" id="ruleLength" isDynamic variant={ruleLength as any}>
|
|
61
|
+
Must be at least 5 characters in length
|
|
62
|
+
</HelperTextItem>
|
|
63
|
+
<HelperTextItem component="li" id="ruleCharacterTypes" isDynamic variant={ruleCharacterTypes as any}>
|
|
64
|
+
Must include at least 1 number
|
|
65
|
+
</HelperTextItem>
|
|
66
|
+
</HelperText>
|
|
67
|
+
</FormHelperText>
|
|
68
|
+
</FormGroup>
|
|
69
|
+
</Form>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form, FormGroup, FormHelperText, TextInput, HelperText, HelperTextItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const HelperTextStaticVariantDynamicText: React.FunctionComponent = () => {
|
|
5
|
+
const [value, setValue] = React.useState('');
|
|
6
|
+
const [inputValidation, setInputValidation] = React.useState('default');
|
|
7
|
+
|
|
8
|
+
const handleInputChange = (inputValue: string) => {
|
|
9
|
+
setValue(inputValue);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
if (value === '') {
|
|
14
|
+
setInputValidation('default');
|
|
15
|
+
} else if (value === 'johndoe') {
|
|
16
|
+
setInputValidation('error');
|
|
17
|
+
} else {
|
|
18
|
+
setInputValidation('success');
|
|
19
|
+
}
|
|
20
|
+
}, [value]);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Form>
|
|
24
|
+
<FormGroup label="Username" isRequired fieldId="login-input-helper-text2">
|
|
25
|
+
<TextInput
|
|
26
|
+
isRequired
|
|
27
|
+
type="text"
|
|
28
|
+
id="login-input-helper-text2"
|
|
29
|
+
name="login-input-helper-text2"
|
|
30
|
+
onChange={handleInputChange}
|
|
31
|
+
aria-describedby="helper-text2"
|
|
32
|
+
aria-invalid={inputValidation === 'error'}
|
|
33
|
+
value={value}
|
|
34
|
+
/>
|
|
35
|
+
<FormHelperText isHidden={false} component="div">
|
|
36
|
+
<HelperText id="helper-text2" aria-live="polite">
|
|
37
|
+
{inputValidation !== 'success' && (
|
|
38
|
+
<HelperTextItem variant={inputValidation as any} hasIcon={inputValidation === 'error'}>
|
|
39
|
+
{inputValidation === 'default' ? 'Please enter a username' : 'Username already exists'}
|
|
40
|
+
</HelperTextItem>
|
|
41
|
+
)}
|
|
42
|
+
</HelperText>
|
|
43
|
+
</FormHelperText>
|
|
44
|
+
</FormGroup>
|
|
45
|
+
</Form>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form, FormGroup, FormHelperText, TextInput, HelperText, HelperTextItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const HelperTextStaticVariantStaticText: React.FunctionComponent = () => {
|
|
5
|
+
const [value, setValue] = React.useState('');
|
|
6
|
+
|
|
7
|
+
const handleInputChange = (inputValue: string) => {
|
|
8
|
+
setValue(inputValue);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Form>
|
|
13
|
+
<FormGroup label="Middle Name" fieldId="login-input-helper-text1">
|
|
14
|
+
<TextInput
|
|
15
|
+
type="text"
|
|
16
|
+
id="login-input-helper-text1"
|
|
17
|
+
name="login-input-helper-text1"
|
|
18
|
+
onChange={handleInputChange}
|
|
19
|
+
aria-describedby="helper-text1"
|
|
20
|
+
value={value}
|
|
21
|
+
/>
|
|
22
|
+
<FormHelperText isHidden={false} component="div">
|
|
23
|
+
<HelperText id="helper-text1">
|
|
24
|
+
<HelperTextItem variant={'default'}>Enter your middle name or your middle initial</HelperTextItem>
|
|
25
|
+
</HelperText>
|
|
26
|
+
</FormHelperText>
|
|
27
|
+
</FormGroup>
|
|
28
|
+
</Form>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
PageSection,
|
|
4
|
-
PageSectionVariants,
|
|
5
4
|
Tabs,
|
|
6
5
|
Tab,
|
|
7
6
|
TabContent,
|
|
@@ -16,7 +15,7 @@ import {
|
|
|
16
15
|
CardBody,
|
|
17
16
|
CardHeader
|
|
18
17
|
} from '@patternfly/react-core';
|
|
19
|
-
import DashboardWrapper from '
|
|
18
|
+
import DashboardWrapper from '../DashboardWrapper';
|
|
20
19
|
|
|
21
20
|
export const GrayTabsDemo: React.FunctionComponent = () => {
|
|
22
21
|
const [activeTabKey, setActiveTabKey] = React.useState<string | number>(0);
|
|
@@ -126,12 +125,7 @@ export const GrayTabsDemo: React.FunctionComponent = () => {
|
|
|
126
125
|
);
|
|
127
126
|
|
|
128
127
|
return (
|
|
129
|
-
<DashboardWrapper
|
|
130
|
-
<PageSection isWidthLimited variant={PageSectionVariants.light}>
|
|
131
|
-
<Title headingLevel="h1" size="2xl">
|
|
132
|
-
Overview
|
|
133
|
-
</Title>
|
|
134
|
-
</PageSection>
|
|
128
|
+
<DashboardWrapper hasPageTemplateTitle>
|
|
135
129
|
<PageSection type="tabs" isWidthLimited>
|
|
136
130
|
<Tabs
|
|
137
131
|
activeKey={activeTabKey}
|
|
@@ -81,7 +81,7 @@ export const ModalTabs: React.FunctionComponent = () => {
|
|
|
81
81
|
|
|
82
82
|
return (
|
|
83
83
|
<React.Fragment>
|
|
84
|
-
<DashboardWrapper mainContainerId="main-content-card-view-default-nav"
|
|
84
|
+
<DashboardWrapper mainContainerId="main-content-card-view-default-nav">
|
|
85
85
|
<PageSection variant={PageSectionVariants.light}>
|
|
86
86
|
<TextContent>
|
|
87
87
|
<Text component="h1">Projects</Text>
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
Grid,
|
|
7
7
|
GridItem,
|
|
8
8
|
PageSection,
|
|
9
|
-
PageSectionVariants,
|
|
10
9
|
Tabs,
|
|
11
10
|
Tab,
|
|
12
11
|
TabContent,
|
|
@@ -16,17 +15,17 @@ import {
|
|
|
16
15
|
Flex,
|
|
17
16
|
FlexItem
|
|
18
17
|
} from '@patternfly/react-core';
|
|
19
|
-
import DashboardWrapper from '../
|
|
18
|
+
import DashboardWrapper from '../DashboardWrapper';
|
|
20
19
|
|
|
21
|
-
export const
|
|
20
|
+
export const NestedTabs: React.FunctionComponent = () => {
|
|
22
21
|
const [activeTabKey, setActiveTabKey] = React.useState(0);
|
|
23
22
|
const [activeNestedTabKey, setActiveNestedTabKey] = React.useState(10);
|
|
24
23
|
|
|
25
24
|
// Toggle currently active tab
|
|
26
|
-
const handleTabClick = (
|
|
25
|
+
const handleTabClick = (tabIndex: number) => setActiveTabKey(tabIndex);
|
|
27
26
|
|
|
28
27
|
// Toggle currently active nested tab
|
|
29
|
-
const handleNestedTabClick = (
|
|
28
|
+
const handleNestedTabClick = (tabIndex: number) => setActiveNestedTabKey(tabIndex);
|
|
30
29
|
|
|
31
30
|
const tabContent = (
|
|
32
31
|
<Grid hasGutter>
|
|
@@ -41,7 +40,7 @@ export const NestedTabsDemo = () => {
|
|
|
41
40
|
<Tabs
|
|
42
41
|
activeKey={activeNestedTabKey}
|
|
43
42
|
isSecondary
|
|
44
|
-
onSelect={handleNestedTabClick}
|
|
43
|
+
onSelect={(_event, tabIndex) => handleNestedTabClick(Number(tabIndex))}
|
|
45
44
|
id="nested-tabs-example-nested-tabs-list"
|
|
46
45
|
>
|
|
47
46
|
<Tab eventKey={10} title={<TabTitleText>Cluster</TabTitleText>} tabContentId={`tabContent${10}`} />
|
|
@@ -126,14 +125,14 @@ export const NestedTabsDemo = () => {
|
|
|
126
125
|
);
|
|
127
126
|
|
|
128
127
|
return (
|
|
129
|
-
<DashboardWrapper
|
|
130
|
-
<PageSection isWidthLimited variant={PageSectionVariants.light}>
|
|
131
|
-
<Title headingLevel="h1" size="2xl">
|
|
132
|
-
Overview
|
|
133
|
-
</Title>
|
|
134
|
-
</PageSection>
|
|
128
|
+
<DashboardWrapper hasPageTemplateTitle>
|
|
135
129
|
<PageSection type="tabs" isWidthLimited>
|
|
136
|
-
<Tabs
|
|
130
|
+
<Tabs
|
|
131
|
+
activeKey={activeTabKey}
|
|
132
|
+
onSelect={(_event, tabIndex) => handleTabClick(Number(tabIndex))}
|
|
133
|
+
usePageInsets
|
|
134
|
+
id="nested-tabs-example-tabs-list"
|
|
135
|
+
>
|
|
137
136
|
<Tab eventKey={0} title={<TabTitleText>Cluster 1</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
138
137
|
<Tab eventKey={1} title={<TabTitleText>Cluster 2</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
139
138
|
</Tabs>
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardHeader,
|
|
5
|
+
CardBody,
|
|
6
|
+
Grid,
|
|
7
|
+
GridItem,
|
|
8
|
+
PageSection,
|
|
9
|
+
Tabs,
|
|
10
|
+
Tab,
|
|
11
|
+
TabContent,
|
|
12
|
+
TabContentBody,
|
|
13
|
+
TabTitleText,
|
|
14
|
+
Title,
|
|
15
|
+
Text,
|
|
16
|
+
TextContent,
|
|
17
|
+
TitleSizes
|
|
18
|
+
} from '@patternfly/react-core';
|
|
19
|
+
import DashboardWrapper from '../DashboardWrapper';
|
|
20
|
+
|
|
21
|
+
export const NestedUnindentedTabs: React.FunctionComponent = () => {
|
|
22
|
+
const [activeTabKey, setActiveTabKey] = React.useState(1);
|
|
23
|
+
const [activeNestedTabKey, setActiveNestedTabKey] = React.useState(10);
|
|
24
|
+
|
|
25
|
+
// Toggle currently active tab
|
|
26
|
+
const handleTabClick = (tabIndex: number) => setActiveTabKey(tabIndex);
|
|
27
|
+
|
|
28
|
+
// Toggle currently active nested tab
|
|
29
|
+
const handleNestedTabClick = (tabIndex: number) => setActiveNestedTabKey(tabIndex);
|
|
30
|
+
|
|
31
|
+
const tabContent = (
|
|
32
|
+
<Grid hasGutter>
|
|
33
|
+
<GridItem>
|
|
34
|
+
<CardHeader>
|
|
35
|
+
<Title headingLevel="h1" size={TitleSizes['2xl']}>
|
|
36
|
+
Get started with Red Hat Enterprise Linux
|
|
37
|
+
</Title>
|
|
38
|
+
</CardHeader>
|
|
39
|
+
</GridItem>
|
|
40
|
+
<GridItem>
|
|
41
|
+
<Tabs
|
|
42
|
+
activeKey={activeNestedTabKey}
|
|
43
|
+
isSecondary
|
|
44
|
+
onSelect={(_event, tabIndex) => handleNestedTabClick(Number(tabIndex))}
|
|
45
|
+
id="nested-tabs-example-nested-tabs-list"
|
|
46
|
+
>
|
|
47
|
+
<Tab eventKey={10} title={<TabTitleText>x86 architecture</TabTitleText>} tabContentId={`tabContent${10}`} />
|
|
48
|
+
<Tab
|
|
49
|
+
eventKey={11}
|
|
50
|
+
title={<TabTitleText>Additional Architectures</TabTitleText>}
|
|
51
|
+
tabContentId={`tabContent${11}`}
|
|
52
|
+
/>
|
|
53
|
+
</Tabs>
|
|
54
|
+
</GridItem>
|
|
55
|
+
<GridItem>
|
|
56
|
+
<TabContent
|
|
57
|
+
key={10}
|
|
58
|
+
eventKey={10}
|
|
59
|
+
id={`tabContent${10}`}
|
|
60
|
+
activeKey={activeNestedTabKey}
|
|
61
|
+
hidden={10 !== activeNestedTabKey}
|
|
62
|
+
>
|
|
63
|
+
<TabContentBody>
|
|
64
|
+
<Grid hasGutter>
|
|
65
|
+
<GridItem>
|
|
66
|
+
<TextContent>
|
|
67
|
+
<Text>To perform a standard x86_64 installation using the GUI, you'll need to:</Text>
|
|
68
|
+
</TextContent>
|
|
69
|
+
</GridItem>
|
|
70
|
+
<Grid md={6} xl2={3} hasGutter>
|
|
71
|
+
<GridItem>
|
|
72
|
+
<Card isFullHeight>
|
|
73
|
+
<CardHeader>Check system requirements</CardHeader>
|
|
74
|
+
<CardBody>
|
|
75
|
+
Your physical or virtual machine should meet the <a href="#">system requirement</a>.
|
|
76
|
+
</CardBody>
|
|
77
|
+
</Card>
|
|
78
|
+
</GridItem>
|
|
79
|
+
|
|
80
|
+
<GridItem>
|
|
81
|
+
<Card isFullHeight>
|
|
82
|
+
<CardHeader>Download an installation ISO image</CardHeader>
|
|
83
|
+
<CardBody>
|
|
84
|
+
{' '}
|
|
85
|
+
<a href="#">Download</a> the binary DVD ISO.
|
|
86
|
+
</CardBody>
|
|
87
|
+
</Card>
|
|
88
|
+
</GridItem>
|
|
89
|
+
<GridItem>
|
|
90
|
+
<Card isFullHeight>
|
|
91
|
+
<CardHeader>Create a bootable installation media</CardHeader>
|
|
92
|
+
<CardBody>
|
|
93
|
+
{' '}
|
|
94
|
+
<a href="#">Create</a> a bootable installation media, for example a USB flash drive.
|
|
95
|
+
</CardBody>
|
|
96
|
+
</Card>
|
|
97
|
+
</GridItem>
|
|
98
|
+
<GridItem>
|
|
99
|
+
<Card isFullHeight>
|
|
100
|
+
<CardHeader>Install and register your system</CardHeader>
|
|
101
|
+
<CardBody>
|
|
102
|
+
Boot the installation, register your system, attach RHEL subscriptions, and install RHEL from the
|
|
103
|
+
Red Hat Content Delivery Network (CDN) using the GUI.
|
|
104
|
+
</CardBody>
|
|
105
|
+
</Card>
|
|
106
|
+
</GridItem>
|
|
107
|
+
</Grid>
|
|
108
|
+
</Grid>
|
|
109
|
+
</TabContentBody>
|
|
110
|
+
</TabContent>
|
|
111
|
+
<TabContent
|
|
112
|
+
key={11}
|
|
113
|
+
eventKey={11}
|
|
114
|
+
id={`tabContent${11}`}
|
|
115
|
+
activeKey={activeNestedTabKey}
|
|
116
|
+
hidden={11 !== activeNestedTabKey}
|
|
117
|
+
>
|
|
118
|
+
<TabContentBody>Additional architectures panel</TabContentBody>
|
|
119
|
+
</TabContent>
|
|
120
|
+
<TabContent
|
|
121
|
+
key={12}
|
|
122
|
+
eventKey={12}
|
|
123
|
+
id={`tabContent${12}`}
|
|
124
|
+
activeKey={activeNestedTabKey}
|
|
125
|
+
hidden={12 !== activeNestedTabKey}
|
|
126
|
+
>
|
|
127
|
+
<TabContentBody>Operators panel</TabContentBody>
|
|
128
|
+
</TabContent>
|
|
129
|
+
<TabContent
|
|
130
|
+
key={13}
|
|
131
|
+
eventKey={13}
|
|
132
|
+
id={`tabContent${13}`}
|
|
133
|
+
activeKey={activeNestedTabKey}
|
|
134
|
+
hidden={13 !== activeNestedTabKey}
|
|
135
|
+
>
|
|
136
|
+
<TabContentBody>Virtualization panel</TabContentBody>
|
|
137
|
+
</TabContent>
|
|
138
|
+
</GridItem>
|
|
139
|
+
</Grid>
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<DashboardWrapper hasPageTemplateTitle>
|
|
144
|
+
<PageSection type="tabs" isWidthLimited variant="light">
|
|
145
|
+
<Tabs
|
|
146
|
+
isBox
|
|
147
|
+
activeKey={activeTabKey}
|
|
148
|
+
onSelect={(_event, tabIndex) => handleTabClick(Number(tabIndex))}
|
|
149
|
+
usePageInsets
|
|
150
|
+
id="nested-tabs-example-tabs-list"
|
|
151
|
+
>
|
|
152
|
+
<Tab eventKey={0} title={<TabTitleText>What's new</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
153
|
+
<Tab eventKey={1} title={<TabTitleText>Get started</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
154
|
+
<Tab eventKey={2} title={<TabTitleText>Knowledge</TabTitleText>} tabContentId={`tabContent${2}`} />
|
|
155
|
+
<Tab eventKey={3} title={<TabTitleText>Support</TabTitleText>} tabContentId={`tabContent${3}`} />
|
|
156
|
+
</Tabs>
|
|
157
|
+
</PageSection>
|
|
158
|
+
<PageSection variant="light">
|
|
159
|
+
<TabContent key={0} eventKey={0} id={`tabContent${0}`} activeKey={activeTabKey} hidden={0 !== activeTabKey}>
|
|
160
|
+
<TabContentBody>What's new panel</TabContentBody>
|
|
161
|
+
</TabContent>
|
|
162
|
+
<TabContent key={1} eventKey={1} id={`tabContent${1}`} activeKey={activeTabKey} hidden={1 !== activeTabKey}>
|
|
163
|
+
<TabContentBody>{tabContent}</TabContentBody>
|
|
164
|
+
</TabContent>
|
|
165
|
+
<TabContent key={2} eventKey={2} id={`tabContent${2}`} activeKey={activeTabKey} hidden={2 !== activeTabKey}>
|
|
166
|
+
<TabContentBody>Knowledge panel</TabContentBody>
|
|
167
|
+
</TabContent>
|
|
168
|
+
<TabContent key={3} eventKey={3} id={`tabContent${3}`} activeKey={activeTabKey} hidden={3 !== activeTabKey}>
|
|
169
|
+
<TabContentBody>Support Panel</TabContentBody>
|
|
170
|
+
</TabContent>
|
|
171
|
+
</PageSection>
|
|
172
|
+
</DashboardWrapper>
|
|
173
|
+
);
|
|
174
|
+
};
|