@patternfly/react-core 4.234.2 → 4.235.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 +27 -0
- package/dist/esm/components/LoginPage/LoginFooterItem.d.ts +3 -3
- package/dist/esm/components/LoginPage/LoginForm.d.ts +18 -18
- package/dist/esm/components/LoginPage/LoginHeader.d.ts +1 -1
- package/dist/esm/components/LoginPage/LoginMainBody.d.ts +2 -2
- package/dist/esm/components/LoginPage/LoginMainFooter.d.ts +5 -5
- package/dist/esm/components/LoginPage/LoginMainFooterBandItem.d.ts +2 -2
- package/dist/esm/components/LoginPage/LoginMainFooterLinksItem.d.ts +5 -5
- package/dist/esm/components/LoginPage/LoginMainHeader.d.ts +6 -4
- package/dist/esm/components/LoginPage/LoginMainHeader.d.ts.map +1 -1
- package/dist/esm/components/LoginPage/LoginMainHeader.js +2 -1
- package/dist/esm/components/LoginPage/LoginMainHeader.js.map +1 -1
- package/dist/esm/components/LoginPage/LoginPage.d.ts +16 -14
- package/dist/esm/components/LoginPage/LoginPage.d.ts.map +1 -1
- package/dist/esm/components/LoginPage/LoginPage.js +2 -2
- package/dist/esm/components/LoginPage/LoginPage.js.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.d.ts +40 -0
- package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/Wizard.js +86 -0
- package/dist/esm/next/components/Wizard/Wizard.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardBody.d.ts +20 -0
- package/dist/esm/next/components/Wizard/WizardBody.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardBody.js +7 -0
- package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +49 -0
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardContext.js +34 -0
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts +28 -0
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardFooter.js +11 -0
- package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts +21 -0
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardHeader.js +13 -0
- package/dist/esm/next/components/Wizard/WizardHeader.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNav.d.ts +15 -0
- package/dist/esm/next/components/Wizard/WizardNav.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNav.js +13 -0
- package/dist/esm/next/components/Wizard/WizardNav.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +25 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.js +33 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardStep.d.ts +20 -0
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardStep.js +5 -0
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts +26 -0
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardToggle.js +81 -0
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/index.d.ts +2 -0
- package/dist/esm/next/components/Wizard/hooks/index.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/index.js +2 -0
- package/dist/esm/next/components/Wizard/hooks/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts +8 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js +20 -0
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js.map +1 -0
- package/dist/esm/next/components/Wizard/index.d.ts +12 -0
- package/dist/esm/next/components/Wizard/index.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/index.js +12 -0
- package/dist/esm/next/components/Wizard/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/types.d.ts +69 -0
- package/dist/esm/next/components/Wizard/types.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/types.js +20 -0
- package/dist/esm/next/components/Wizard/types.js.map +1 -0
- package/dist/esm/next/components/Wizard/utils.d.ts +15 -0
- package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/utils.js +35 -0
- package/dist/esm/next/components/Wizard/utils.js.map +1 -0
- package/dist/esm/next/components/index.d.ts +1 -1
- package/dist/esm/next/components/index.d.ts.map +1 -1
- package/dist/esm/next/components/index.js +1 -1
- package/dist/esm/next/components/index.js.map +1 -1
- package/dist/js/components/LoginPage/LoginFooterItem.d.ts +3 -3
- package/dist/js/components/LoginPage/LoginForm.d.ts +18 -18
- package/dist/js/components/LoginPage/LoginHeader.d.ts +1 -1
- package/dist/js/components/LoginPage/LoginMainBody.d.ts +2 -2
- package/dist/js/components/LoginPage/LoginMainFooter.d.ts +5 -5
- package/dist/js/components/LoginPage/LoginMainFooterBandItem.d.ts +2 -2
- package/dist/js/components/LoginPage/LoginMainFooterLinksItem.d.ts +5 -5
- package/dist/js/components/LoginPage/LoginMainHeader.d.ts +6 -4
- package/dist/js/components/LoginPage/LoginMainHeader.d.ts.map +1 -1
- package/dist/js/components/LoginPage/LoginMainHeader.js +2 -1
- package/dist/js/components/LoginPage/LoginMainHeader.js.map +1 -1
- package/dist/js/components/LoginPage/LoginPage.d.ts +16 -14
- package/dist/js/components/LoginPage/LoginPage.d.ts.map +1 -1
- package/dist/js/components/LoginPage/LoginPage.js +2 -2
- package/dist/js/components/LoginPage/LoginPage.js.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.d.ts +40 -0
- package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/Wizard.js +90 -0
- package/dist/js/next/components/Wizard/Wizard.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardBody.d.ts +20 -0
- package/dist/js/next/components/Wizard/WizardBody.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardBody.js +12 -0
- package/dist/js/next/components/Wizard/WizardBody.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardContext.d.ts +49 -0
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardContext.js +40 -0
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardFooter.d.ts +28 -0
- package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardFooter.js +16 -0
- package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardHeader.d.ts +21 -0
- package/dist/js/next/components/Wizard/WizardHeader.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardHeader.js +18 -0
- package/dist/js/next/components/Wizard/WizardHeader.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNav.d.ts +15 -0
- package/dist/js/next/components/Wizard/WizardNav.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNav.js +18 -0
- package/dist/js/next/components/Wizard/WizardNav.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts +25 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.js +37 -0
- package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardStep.d.ts +20 -0
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardStep.js +10 -0
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardToggle.d.ts +26 -0
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardToggle.js +86 -0
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -0
- package/dist/js/next/components/Wizard/hooks/index.d.ts +2 -0
- package/dist/js/next/components/Wizard/hooks/index.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/hooks/index.js +6 -0
- package/dist/js/next/components/Wizard/hooks/index.js.map +1 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts +8 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js +25 -0
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js.map +1 -0
- package/dist/js/next/components/Wizard/index.d.ts +12 -0
- package/dist/js/next/components/Wizard/index.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/index.js +17 -0
- package/dist/js/next/components/Wizard/index.js.map +1 -0
- package/dist/js/next/components/Wizard/types.d.ts +69 -0
- package/dist/js/next/components/Wizard/types.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/types.js +29 -0
- package/dist/js/next/components/Wizard/types.js.map +1 -0
- package/dist/js/next/components/Wizard/utils.d.ts +15 -0
- package/dist/js/next/components/Wizard/utils.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/utils.js +41 -0
- package/dist/js/next/components/Wizard/utils.js.map +1 -0
- package/dist/js/next/components/index.d.ts +1 -1
- package/dist/js/next/components/index.d.ts.map +1 -1
- package/dist/js/next/components/index.js +1 -1
- package/dist/js/next/components/index.js.map +1 -1
- package/dist/umd/react-core.css +208 -208
- package/dist/umd/react-core.js +4 -3
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Card/examples/Card.md +67 -38
- package/src/components/LoginPage/LoginFooterItem.tsx +3 -3
- package/src/components/LoginPage/LoginForm.tsx +18 -18
- package/src/components/LoginPage/LoginHeader.tsx +1 -1
- package/src/components/LoginPage/LoginMainBody.tsx +2 -2
- package/src/components/LoginPage/LoginMainFooter.tsx +5 -5
- package/src/components/LoginPage/LoginMainFooterBandItem.tsx +2 -2
- package/src/components/LoginPage/LoginMainFooterLinksItem.tsx +5 -5
- package/src/components/LoginPage/LoginMainHeader.tsx +8 -4
- package/src/components/LoginPage/LoginPage.tsx +18 -15
- package/src/components/LoginPage/examples/LoginPage.md +8 -0
- package/src/components/LoginPage/examples/LoginPageBasic.tsx +0 -1
- package/src/components/LoginPage/examples/LoginPageLanguageSelect.tsx +194 -0
- package/src/components/LoginPage/examples/LoginPageShowHidePassword.tsx +0 -1
- package/src/components/Wizard/examples/Wizard.md +21 -4
- package/src/demos/CardDemos.md +4 -0
- package/src/next/components/Wizard/Wizard.tsx +184 -0
- package/src/next/components/Wizard/WizardBody.tsx +34 -0
- package/src/next/components/Wizard/WizardContext.tsx +104 -0
- package/src/next/components/Wizard/WizardFooter.tsx +63 -0
- package/src/next/components/Wizard/WizardHeader.tsx +53 -0
- package/src/next/components/Wizard/WizardNav.tsx +41 -0
- package/src/next/components/Wizard/WizardNavItem.tsx +103 -0
- package/src/next/components/Wizard/WizardStep.tsx +23 -0
- package/src/next/components/Wizard/WizardToggle.tsx +209 -0
- package/src/next/components/Wizard/__tests__/Wizard.test.tsx +298 -0
- package/src/next/components/Wizard/examples/Wizard.md +125 -0
- package/src/next/components/Wizard/examples/WizardBasic.tsx +22 -0
- package/src/next/components/Wizard/examples/WizardCustomNav.tsx +46 -0
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +170 -0
- package/src/next/components/Wizard/hooks/index.ts +1 -0
- package/src/next/components/Wizard/hooks/useWizardFooter.tsx +22 -0
- package/src/next/components/Wizard/index.ts +11 -0
- package/src/next/components/Wizard/types.tsx +101 -0
- package/src/next/components/Wizard/utils.ts +47 -0
- package/src/next/components/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.235.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",
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
"generate": "node scripts/copyStyles.js"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@patternfly/react-icons": "^4.
|
|
54
|
-
"@patternfly/react-styles": "^4.
|
|
55
|
-
"@patternfly/react-tokens": "^4.
|
|
53
|
+
"@patternfly/react-icons": "^4.86.0",
|
|
54
|
+
"@patternfly/react-styles": "^4.85.0",
|
|
55
|
+
"@patternfly/react-tokens": "^4.87.0",
|
|
56
56
|
"focus-trap": "6.9.2",
|
|
57
57
|
"react-dropzone": "9.0.0",
|
|
58
58
|
"tippy.js": "5.1.2",
|
|
59
59
|
"tslib": "^2.0.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@patternfly/patternfly": "4.210.
|
|
62
|
+
"@patternfly/patternfly": "4.210.2",
|
|
63
63
|
"@rollup/plugin-commonjs": "^22.0.2",
|
|
64
64
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
65
65
|
"@rollup/plugin-replace": "^4.0.0",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"react": "^16.8.0 || ^17.0.0",
|
|
77
77
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "0b52df617c2521bea942def9a0b514c16b4859b0"
|
|
80
80
|
}
|
|
@@ -9,101 +9,130 @@ ouia: true
|
|
|
9
9
|
import pfLogo from './pfLogo.svg';
|
|
10
10
|
import pfLogoSmall from './pf-logo-small.svg';
|
|
11
11
|
|
|
12
|
-
## Examples
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Basic cards
|
|
16
|
+
|
|
17
|
+
Basic cards typically have a `<CardTitle>`, `<CardBody>` and `<CardFooter>`. You may omit these components as needed, but it is recommended to at least include a `<CardBody>` to provide details about the card item.
|
|
15
18
|
|
|
16
19
|
```ts file='./CardBasic.tsx'
|
|
17
20
|
```
|
|
18
21
|
|
|
19
|
-
###
|
|
22
|
+
### Modifiers
|
|
23
|
+
|
|
24
|
+
You can further modify the styling of the card's content by using the properties outlined below. In this example, you can enable each modifier by selecting its respective checkbox.
|
|
25
|
+
|
|
26
|
+
Most modifiers can be used in combination with each other, except for `isCompact` and `isLarge`, since they are contradictory.
|
|
20
27
|
|
|
21
28
|
```ts file='./CardWithModifiers.tsx'
|
|
22
29
|
```
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
| Modifier | Description |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| isCompact | Modifies the card to include compact styling. Should not be used with isLarge. |
|
|
34
|
+
| isFlat | Modifies the card to include flat styling. |
|
|
35
|
+
| isRounded | Modifies the card to include rounded border styling. |
|
|
36
|
+
| isLarge | Modifies the card to be large. Should not be used with isCompact. |
|
|
37
|
+
| isFullHeight | Modifies the card so that it fills the total available height of its container. |
|
|
38
|
+
| isPlain | Modifies the card to include plain styling, which removes the border and background. |
|
|
25
39
|
|
|
26
|
-
```ts file='./CardWithImageAndActions.tsx'
|
|
27
|
-
```
|
|
28
40
|
|
|
29
|
-
### Header
|
|
41
|
+
### Header images and actions
|
|
30
42
|
|
|
31
|
-
|
|
32
|
-
```
|
|
43
|
+
You can include header images within `<CardHeaderMain>` and header actions within `<CardActions>`. The following example includes an image using the [Brand](/components/brand) component, and also includes a kebab dropdown and a checkbox in `<CardActions>`.
|
|
33
44
|
|
|
34
|
-
|
|
45
|
+
`<CardActions>` includes the `hasNoOffset` property, which is `false` by default. When `hasNoOffset` is `false`, a negative margin is applied to help align default-sized card titles with `<CardActions>`.
|
|
35
46
|
|
|
36
|
-
|
|
37
|
-
```
|
|
47
|
+
You may use `hasNoOffset` to remove this negative margin, which better aligns `<CardActions>` in implementations that use large card titles or tall header images, for example.
|
|
38
48
|
|
|
39
|
-
|
|
49
|
+
Select the "actions hasNoOffset" checkbox in the example below to illustrate this behavior.
|
|
40
50
|
|
|
41
|
-
```ts file='./
|
|
51
|
+
```ts file='./CardWithImageAndActions.tsx'
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
###
|
|
54
|
+
### Title inline with images and actions
|
|
45
55
|
|
|
46
|
-
|
|
56
|
+
Moving `<CardTitle>` within the `<CardHeader>` will style it inline with any images or actions.
|
|
57
|
+
|
|
58
|
+
```ts file='./CardHeaderInCardHead.tsx'
|
|
47
59
|
```
|
|
48
60
|
|
|
49
|
-
###
|
|
61
|
+
### Card header without title
|
|
50
62
|
|
|
51
|
-
|
|
63
|
+
`<CardActions>` can be placed in the card header even without a `<CardTitle>`.
|
|
64
|
+
|
|
65
|
+
Images can also be placed in the card header within `<CardHeaderMain>` without a `<CardTitle>`.
|
|
66
|
+
|
|
67
|
+
```ts file='./CardOnlyActionsInCardHead.tsx'
|
|
52
68
|
```
|
|
53
69
|
|
|
54
|
-
### With
|
|
70
|
+
### With HTML heading element
|
|
71
|
+
|
|
72
|
+
You may use the `component` property to place the card's title within an HTML heading element.
|
|
55
73
|
|
|
56
|
-
```ts file='./
|
|
74
|
+
```ts file='./CardWithHeadingElement.tsx'
|
|
57
75
|
```
|
|
58
76
|
|
|
59
77
|
### With multiple body sections
|
|
60
78
|
|
|
79
|
+
You may use multiple body sections to visually separate blocks of content.
|
|
80
|
+
|
|
61
81
|
```ts file='./CardWithMultipleBodySections.tsx'
|
|
62
82
|
```
|
|
63
83
|
|
|
64
|
-
### With
|
|
84
|
+
### With a primary body section that fills
|
|
85
|
+
|
|
86
|
+
`<CardBody>` sections will fill the available height of the card when `isFilled` equals `{true}`, which is the default value. Set `isFilled` to `{false}` to disable this behavior for one or more body sections. The remaining available height of the card will be split between any `<CardBody>` section that does not set `isFilled` to `{false}`.
|
|
87
|
+
|
|
88
|
+
A common use case of this is to set all but one body section to `isFilled={false}` so that a primary body section fills the available space of the card as seen in the example below. This example has 3 `<CardBody>` sections, two of which set `isFilled` to `{false}`. The third `<CardBody>` fills the remaining height of the card.
|
|
65
89
|
|
|
66
90
|
```ts file='./CardWithBodySectionFills.tsx'
|
|
67
91
|
```
|
|
68
92
|
|
|
69
|
-
### Selectable
|
|
93
|
+
### Selectable cards
|
|
94
|
+
|
|
95
|
+
Selectable cards can only be selected one at a time, and are intended for use with [primary-detail layout](/demos/primary-detail).
|
|
70
96
|
|
|
71
97
|
```ts file='./CardSelectable.tsx'
|
|
72
98
|
```
|
|
73
99
|
|
|
74
|
-
###
|
|
100
|
+
### Legacy selectable cards
|
|
101
|
+
|
|
102
|
+
The following example shows a legacy implementation of selectable cards. This example uses the `isSelectable` property instead of `isSelectableRaised`, which is the current recommendation for implementation. `isSelectable` applies selectable styling, but does not apply raised styling on hover and selection as `isSelectableRaised` does.
|
|
103
|
+
|
|
104
|
+
```ts file='./CardLegacySelectable.tsx'
|
|
105
|
+
```
|
|
75
106
|
|
|
76
|
-
|
|
107
|
+
### Selectable card accessibility features
|
|
77
108
|
|
|
78
|
-
The
|
|
109
|
+
The following cards demonstrate how the `hasSelectableInput` and `onSelectableInputChange` properties improve accessibility for selectable cards.
|
|
79
110
|
|
|
80
|
-
|
|
111
|
+
The first card sets `hasSelectableInput` to true, which renders a checkbox input that is only visible to, and navigable by, screen readers. This input communicates to assistive technology users that a card is selectable, and if so, also communicates the current selection state.
|
|
81
112
|
|
|
82
|
-
|
|
113
|
+
By default, this input will have an aria-label that corresponds to the `<CardTitle>`. If this isn't defined, then you must pass a custom aria-label using the `selectableInputAriaLabel` property.
|
|
83
114
|
|
|
84
|
-
The
|
|
115
|
+
The first card passes an onChange callback to `onSelectableInputChange` to enable the selection/deselection of the associated card via checkbox input.
|
|
85
116
|
|
|
86
|
-
|
|
117
|
+
The second card does not set `hasSelectableInput` to true, so neither the input nor the selection state is communicated to users of assistive technologies.
|
|
118
|
+
|
|
119
|
+
We recommend navigating this example using a screen reader to best understand both cards.
|
|
87
120
|
|
|
88
121
|
```ts file='./CardSelectableA11yHighlight.tsx'
|
|
89
122
|
```
|
|
90
123
|
|
|
91
|
-
###
|
|
124
|
+
### Expandable cards
|
|
92
125
|
|
|
93
|
-
|
|
94
|
-
```
|
|
126
|
+
A card can be made expandable using the `isExpanded` property. In the collapsed state, only the card header is shown, and the user can click the caret to view the rest of the card content.
|
|
95
127
|
|
|
96
|
-
|
|
128
|
+
Place any content that you want to be hidden within the `<CardExpandableContent>` component.
|
|
97
129
|
|
|
98
130
|
```ts file='./CardExpandable.tsx'
|
|
99
131
|
```
|
|
100
132
|
|
|
101
133
|
### Expandable with icon
|
|
102
134
|
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Legacy selectable
|
|
135
|
+
An image can be placed in the card header to show users an icon beside the expansion caret.
|
|
107
136
|
|
|
108
|
-
```ts file='./
|
|
137
|
+
```ts file='./CardExpandableWithIcon.tsx'
|
|
109
138
|
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
export interface LoginFooterItemProps extends React.HTMLProps<HTMLAnchorElement> {
|
|
4
|
-
/** Content rendered inside the footer
|
|
4
|
+
/** Content rendered inside the footer link item */
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
-
/** Additional classes added to the
|
|
6
|
+
/** Additional classes added to the footer link item */
|
|
7
7
|
className?: string;
|
|
8
|
-
/** The URL of the
|
|
8
|
+
/** The URL of the footer link item */
|
|
9
9
|
href?: string;
|
|
10
10
|
/** Specifies where to open the linked document */
|
|
11
11
|
target?: string;
|
|
@@ -11,29 +11,29 @@ import EyeIcon from '@patternfly/react-icons/dist/esm/icons/eye-icon';
|
|
|
11
11
|
export interface LoginFormProps extends React.HTMLProps<HTMLFormElement> {
|
|
12
12
|
/** Flag to indicate if the first dropdown item should not gain initial focus */
|
|
13
13
|
noAutoFocus?: boolean;
|
|
14
|
-
/** Additional classes added to the
|
|
14
|
+
/** Additional classes added to the login main body's form */
|
|
15
15
|
className?: string;
|
|
16
|
-
/** Flag indicating the
|
|
16
|
+
/** Flag indicating the helper text is visible * */
|
|
17
17
|
showHelperText?: boolean;
|
|
18
|
-
/** Content displayed in the
|
|
18
|
+
/** Content displayed in the helper text component * */
|
|
19
19
|
helperText?: React.ReactNode;
|
|
20
|
-
/** Icon displayed to the left in the
|
|
20
|
+
/** Icon displayed to the left in the helper text */
|
|
21
21
|
helperTextIcon?: React.ReactNode;
|
|
22
|
-
/** Label for the
|
|
22
|
+
/** Label for the username input field */
|
|
23
23
|
usernameLabel?: string;
|
|
24
|
-
/** Value for the
|
|
24
|
+
/** Value for the username */
|
|
25
25
|
usernameValue?: string;
|
|
26
|
-
/** Function that handles the onChange event for the
|
|
26
|
+
/** Function that handles the onChange event for the username */
|
|
27
27
|
onChangeUsername?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
|
|
28
|
-
/** Flag indicating if the
|
|
28
|
+
/** Flag indicating if the username is valid */
|
|
29
29
|
isValidUsername?: boolean;
|
|
30
|
-
/** Label for the
|
|
30
|
+
/** Label for the password input field */
|
|
31
31
|
passwordLabel?: string;
|
|
32
|
-
/** Value for the
|
|
32
|
+
/** Value for the password */
|
|
33
33
|
passwordValue?: string;
|
|
34
|
-
/** Function that handles the onChange event for the
|
|
34
|
+
/** Function that handles the onChange event for the password */
|
|
35
35
|
onChangePassword?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
|
|
36
|
-
/** Flag indicating if the
|
|
36
|
+
/** Flag indicating if the password is valid */
|
|
37
37
|
isValidPassword?: boolean;
|
|
38
38
|
/** Flag indicating if the user can toggle hiding the password */
|
|
39
39
|
isShowPasswordEnabled?: boolean;
|
|
@@ -41,17 +41,17 @@ export interface LoginFormProps extends React.HTMLProps<HTMLFormElement> {
|
|
|
41
41
|
showPasswordAriaLabel?: string;
|
|
42
42
|
/** Accessible label for the hide password button */
|
|
43
43
|
hidePasswordAriaLabel?: string;
|
|
44
|
-
/** Label for the
|
|
44
|
+
/** Label for the log in button input */
|
|
45
45
|
loginButtonLabel?: string;
|
|
46
|
-
/** Flag indicating if the
|
|
46
|
+
/** Flag indicating if the login button is disabled */
|
|
47
47
|
isLoginButtonDisabled?: boolean;
|
|
48
|
-
/** Function that is called when the
|
|
48
|
+
/** Function that is called when the login button is clicked */
|
|
49
49
|
onLoginButtonClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
50
|
-
/** Label for the
|
|
50
|
+
/** Label for the remember me checkbox that indicates the user should be kept logged in. If the label is not provided, the checkbox will not show. */
|
|
51
51
|
rememberMeLabel?: string;
|
|
52
|
-
/** Flag indicating if the remember me
|
|
52
|
+
/** Flag indicating if the remember me checkbox is checked. */
|
|
53
53
|
isRememberMeChecked?: boolean;
|
|
54
|
-
/** Function that handles the onChange event for the
|
|
54
|
+
/** Function that handles the onChange event for the remember me checkbox */
|
|
55
55
|
onChangeRememberMe?: (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -7,7 +7,7 @@ export interface LoginHeaderProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
/** Additional classes added to the login header */
|
|
9
9
|
className?: string;
|
|
10
|
-
/** Header
|
|
10
|
+
/** Header brand component (e.g. <LoginHeader />) */
|
|
11
11
|
headerBrand?: React.ReactNode;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -3,9 +3,9 @@ import { css } from '@patternfly/react-styles';
|
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/Login/login';
|
|
4
4
|
|
|
5
5
|
export interface LoginMainBodyProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
-
/** Content rendered inside the
|
|
6
|
+
/** Content rendered inside the login main body */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
-
/** Additional classes added to the
|
|
8
|
+
/** Additional classes added to the login main body */
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -3,15 +3,15 @@ import { css } from '@patternfly/react-styles';
|
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/Login/login';
|
|
4
4
|
|
|
5
5
|
export interface LoginMainFooterProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
-
/** Additional classes added to the
|
|
6
|
+
/** Additional classes added to the login main footer */
|
|
7
7
|
className?: string;
|
|
8
|
-
/** Content rendered inside the
|
|
8
|
+
/** Content rendered inside the login main footer */
|
|
9
9
|
children?: React.ReactNode;
|
|
10
|
-
/** Content rendered inside the
|
|
10
|
+
/** Content rendered inside the login main footer as social media links* */
|
|
11
11
|
socialMediaLoginContent?: React.ReactNode;
|
|
12
|
-
/** Content rendered inside of
|
|
12
|
+
/** Content rendered inside of login main footer band to display a sign up for account message */
|
|
13
13
|
signUpForAccountMessage?: React.ReactNode;
|
|
14
|
-
/** Content rendered inside of
|
|
14
|
+
/** Content rendered inside of login main footer band do display a forgot credentials link* */
|
|
15
15
|
forgotCredentials?: React.ReactNode;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -3,9 +3,9 @@ import styles from '@patternfly/react-styles/css/components/Login/login';
|
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
|
|
5
5
|
export interface LoginMainFooterBandItemProps extends React.HTMLProps<HTMLParagraphElement> {
|
|
6
|
-
/** Content rendered inside the footer
|
|
6
|
+
/** Content rendered inside the footer link item */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
-
/** Additional classes added to the
|
|
8
|
+
/** Additional classes added to the footer link item */
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -3,15 +3,15 @@ import styles from '@patternfly/react-styles/css/components/Login/login';
|
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
|
|
5
5
|
export interface LoginMainFooterLinksItemProps extends React.HTMLProps<HTMLLIElement> {
|
|
6
|
-
/** Content rendered inside the footer
|
|
6
|
+
/** Content rendered inside the footer link item */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
-
/** HREF for
|
|
8
|
+
/** HREF for footer link item */
|
|
9
9
|
href?: string;
|
|
10
|
-
/** Target for
|
|
10
|
+
/** Target for footer link item */
|
|
11
11
|
target?: string;
|
|
12
|
-
/** Additional classes added to the
|
|
12
|
+
/** Additional classes added to the footer link item */
|
|
13
13
|
className?: string;
|
|
14
|
-
/** Component used to render the
|
|
14
|
+
/** Component used to render the footer link item */
|
|
15
15
|
linkComponent?: React.ReactNode;
|
|
16
16
|
/** Props for the LinkComponent */
|
|
17
17
|
linkComponentProps?: any;
|
|
@@ -4,14 +4,16 @@ import { css } from '@patternfly/react-styles';
|
|
|
4
4
|
import styles from '@patternfly/react-styles/css/components/Login/login';
|
|
5
5
|
|
|
6
6
|
export interface LoginMainHeaderProps extends React.HTMLProps<HTMLDivElement> {
|
|
7
|
-
/** Content rendered inside the
|
|
7
|
+
/** Content rendered inside the login main header */
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
-
/** Additional classes added to the
|
|
9
|
+
/** Additional classes added to the login main header */
|
|
10
10
|
className?: string;
|
|
11
|
-
/** Title for the
|
|
11
|
+
/** Title for the login main header */
|
|
12
12
|
title?: string;
|
|
13
|
-
/** Subtitle that contains the
|
|
13
|
+
/** Subtitle that contains the text, URL, and URL text for the login main header */
|
|
14
14
|
subtitle?: string;
|
|
15
|
+
/** Actions that render for the login main header */
|
|
16
|
+
headerUtilities?: React.ReactNode;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export const LoginMainHeader: React.FunctionComponent<LoginMainHeaderProps> = ({
|
|
@@ -19,6 +21,7 @@ export const LoginMainHeader: React.FunctionComponent<LoginMainHeaderProps> = ({
|
|
|
19
21
|
className = '',
|
|
20
22
|
title = '',
|
|
21
23
|
subtitle = '',
|
|
24
|
+
headerUtilities = null,
|
|
22
25
|
...props
|
|
23
26
|
}: LoginMainHeaderProps) => (
|
|
24
27
|
<header className={css(styles.loginMainHeader, className)} {...props}>
|
|
@@ -28,6 +31,7 @@ export const LoginMainHeader: React.FunctionComponent<LoginMainHeaderProps> = ({
|
|
|
28
31
|
</Title>
|
|
29
32
|
)}
|
|
30
33
|
{subtitle && <p className={css(styles.loginMainHeaderDesc)}>{subtitle}</p>}
|
|
34
|
+
{headerUtilities && <div className={css(styles.loginMainHeaderUtilities)}>{headerUtilities}</div>}
|
|
31
35
|
{children}
|
|
32
36
|
</header>
|
|
33
37
|
);
|
|
@@ -13,33 +13,35 @@ import { LoginMainBody } from './LoginMainBody';
|
|
|
13
13
|
import { LoginMainFooter } from './LoginMainFooter';
|
|
14
14
|
|
|
15
15
|
export interface LoginPageProps extends React.HTMLProps<HTMLDivElement> {
|
|
16
|
-
/** Anything that can be rendered inside of the
|
|
16
|
+
/** Anything that can be rendered inside of the login page (e.g. <LoginPageForm>) */
|
|
17
17
|
children?: React.ReactNode;
|
|
18
|
-
/** Additional classes added to the
|
|
18
|
+
/** Additional classes added to the login page */
|
|
19
19
|
className?: string;
|
|
20
|
-
/** Attribute that specifies the URL of the brand image for the
|
|
20
|
+
/** Attribute that specifies the URL of the brand image for the login page */
|
|
21
21
|
brandImgSrc?: string;
|
|
22
|
-
/** Attribute that specifies the alt text of the brand image for the
|
|
22
|
+
/** Attribute that specifies the alt text of the brand image for the login page */
|
|
23
23
|
brandImgAlt?: string;
|
|
24
|
-
/** Attribute that specifies the URL of the background image for the
|
|
24
|
+
/** Attribute that specifies the URL of the background image for the login page */
|
|
25
25
|
backgroundImgSrc?: string | BackgroundImageSrcMap;
|
|
26
|
-
/** Attribute that specifies the alt text of the background image for the
|
|
26
|
+
/** Attribute that specifies the alt text of the background image for the login page */
|
|
27
27
|
backgroundImgAlt?: string;
|
|
28
|
-
/** Content rendered inside of the
|
|
28
|
+
/** Content rendered inside of the text component of the login page */
|
|
29
29
|
textContent?: string;
|
|
30
|
-
/** Items rendered inside of the
|
|
30
|
+
/** Items rendered inside of the footer list component of the login page */
|
|
31
31
|
footerListItems?: React.ReactNode;
|
|
32
|
-
/** Adds list variant styles for the
|
|
32
|
+
/** Adds list variant styles for the footer list component of the login page. The only current value is'inline' */
|
|
33
33
|
footerListVariants?: ListVariant.inline;
|
|
34
|
-
/** Title for the
|
|
34
|
+
/** Title for the login main body header of the login page */
|
|
35
35
|
loginTitle: string;
|
|
36
|
-
/** Subtitle for the
|
|
36
|
+
/** Subtitle for the login main body header of the login page */
|
|
37
37
|
loginSubtitle?: string;
|
|
38
|
-
/**
|
|
38
|
+
/** @beta Header utilities for the login main body header of the login page */
|
|
39
|
+
headerUtilities?: React.ReactNode;
|
|
40
|
+
/** Content rendered inside of login main footer band to display a sign up for account message */
|
|
39
41
|
signUpForAccountMessage?: React.ReactNode;
|
|
40
|
-
/** Content rendered inside of
|
|
42
|
+
/** Content rendered inside of login main footer band to display a forgot credentials link. */
|
|
41
43
|
forgotCredentials?: React.ReactNode;
|
|
42
|
-
/** Content rendered inside of
|
|
44
|
+
/** Content rendered inside of social media login footer section */
|
|
43
45
|
socialMediaLoginContent?: React.ReactNode;
|
|
44
46
|
}
|
|
45
47
|
|
|
@@ -55,6 +57,7 @@ export const LoginPage: React.FunctionComponent<LoginPageProps> = ({
|
|
|
55
57
|
footerListVariants,
|
|
56
58
|
loginTitle,
|
|
57
59
|
loginSubtitle,
|
|
60
|
+
headerUtilities,
|
|
58
61
|
signUpForAccountMessage = null,
|
|
59
62
|
forgotCredentials = null,
|
|
60
63
|
socialMediaLoginContent = null,
|
|
@@ -77,7 +80,7 @@ export const LoginPage: React.FunctionComponent<LoginPageProps> = ({
|
|
|
77
80
|
<React.Fragment>
|
|
78
81
|
{backgroundImgSrc && <BackgroundImage src={backgroundImgSrc} alt={backgroundImgAlt} />}
|
|
79
82
|
<Login header={Header} footer={Footer} className={css(className)} {...props}>
|
|
80
|
-
<LoginMainHeader title={loginTitle} subtitle={loginSubtitle} />
|
|
83
|
+
<LoginMainHeader title={loginTitle} subtitle={loginSubtitle} headerUtilities={headerUtilities} />
|
|
81
84
|
<LoginMainBody>{children}</LoginMainBody>
|
|
82
85
|
{(socialMediaLoginContent || forgotCredentials || signUpForAccountMessage) && (
|
|
83
86
|
<LoginMainFooter
|
|
@@ -29,3 +29,11 @@ import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclam
|
|
|
29
29
|
### Show/hide password
|
|
30
30
|
```ts file='./LoginPageShowHidePassword.tsx' isFullscreen
|
|
31
31
|
```
|
|
32
|
+
|
|
33
|
+
### Customizing the header utilities
|
|
34
|
+
|
|
35
|
+
`headerUtilities` is a prop that can be customized to allow components to be placed into the header of the login page, likely for the user to take an action. The following example demonstrates the use of a Select component to display a list a languages.
|
|
36
|
+
|
|
37
|
+
### With header utilities
|
|
38
|
+
```ts file='./LoginPageLanguageSelect.tsx' isFullscreen
|
|
39
|
+
```
|
|
@@ -129,7 +129,6 @@ export const SimpleLoginPage: React.FunctionComponent = () => {
|
|
|
129
129
|
brandImgSrc={brandImg2}
|
|
130
130
|
brandImgAlt="PatternFly logo"
|
|
131
131
|
backgroundImgSrc={images}
|
|
132
|
-
backgroundImgAlt="Images"
|
|
133
132
|
footerListItems={listItem}
|
|
134
133
|
textContent="This is placeholder text only. Use this area to place any information or introductory message about your application that may be relevant to users."
|
|
135
134
|
loginTitle="Log in to your account"
|