@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.
Files changed (191) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/esm/components/LoginPage/LoginFooterItem.d.ts +3 -3
  3. package/dist/esm/components/LoginPage/LoginForm.d.ts +18 -18
  4. package/dist/esm/components/LoginPage/LoginHeader.d.ts +1 -1
  5. package/dist/esm/components/LoginPage/LoginMainBody.d.ts +2 -2
  6. package/dist/esm/components/LoginPage/LoginMainFooter.d.ts +5 -5
  7. package/dist/esm/components/LoginPage/LoginMainFooterBandItem.d.ts +2 -2
  8. package/dist/esm/components/LoginPage/LoginMainFooterLinksItem.d.ts +5 -5
  9. package/dist/esm/components/LoginPage/LoginMainHeader.d.ts +6 -4
  10. package/dist/esm/components/LoginPage/LoginMainHeader.d.ts.map +1 -1
  11. package/dist/esm/components/LoginPage/LoginMainHeader.js +2 -1
  12. package/dist/esm/components/LoginPage/LoginMainHeader.js.map +1 -1
  13. package/dist/esm/components/LoginPage/LoginPage.d.ts +16 -14
  14. package/dist/esm/components/LoginPage/LoginPage.d.ts.map +1 -1
  15. package/dist/esm/components/LoginPage/LoginPage.js +2 -2
  16. package/dist/esm/components/LoginPage/LoginPage.js.map +1 -1
  17. package/dist/esm/next/components/Wizard/Wizard.d.ts +40 -0
  18. package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -0
  19. package/dist/esm/next/components/Wizard/Wizard.js +86 -0
  20. package/dist/esm/next/components/Wizard/Wizard.js.map +1 -0
  21. package/dist/esm/next/components/Wizard/WizardBody.d.ts +20 -0
  22. package/dist/esm/next/components/Wizard/WizardBody.d.ts.map +1 -0
  23. package/dist/esm/next/components/Wizard/WizardBody.js +7 -0
  24. package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -0
  25. package/dist/esm/next/components/Wizard/WizardContext.d.ts +49 -0
  26. package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -0
  27. package/dist/esm/next/components/Wizard/WizardContext.js +34 -0
  28. package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -0
  29. package/dist/esm/next/components/Wizard/WizardFooter.d.ts +28 -0
  30. package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -0
  31. package/dist/esm/next/components/Wizard/WizardFooter.js +11 -0
  32. package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -0
  33. package/dist/esm/next/components/Wizard/WizardHeader.d.ts +21 -0
  34. package/dist/esm/next/components/Wizard/WizardHeader.d.ts.map +1 -0
  35. package/dist/esm/next/components/Wizard/WizardHeader.js +13 -0
  36. package/dist/esm/next/components/Wizard/WizardHeader.js.map +1 -0
  37. package/dist/esm/next/components/Wizard/WizardNav.d.ts +15 -0
  38. package/dist/esm/next/components/Wizard/WizardNav.d.ts.map +1 -0
  39. package/dist/esm/next/components/Wizard/WizardNav.js +13 -0
  40. package/dist/esm/next/components/Wizard/WizardNav.js.map +1 -0
  41. package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +25 -0
  42. package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -0
  43. package/dist/esm/next/components/Wizard/WizardNavItem.js +33 -0
  44. package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -0
  45. package/dist/esm/next/components/Wizard/WizardStep.d.ts +20 -0
  46. package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -0
  47. package/dist/esm/next/components/Wizard/WizardStep.js +5 -0
  48. package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -0
  49. package/dist/esm/next/components/Wizard/WizardToggle.d.ts +26 -0
  50. package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -0
  51. package/dist/esm/next/components/Wizard/WizardToggle.js +81 -0
  52. package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -0
  53. package/dist/esm/next/components/Wizard/hooks/index.d.ts +2 -0
  54. package/dist/esm/next/components/Wizard/hooks/index.d.ts.map +1 -0
  55. package/dist/esm/next/components/Wizard/hooks/index.js +2 -0
  56. package/dist/esm/next/components/Wizard/hooks/index.js.map +1 -0
  57. package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts +8 -0
  58. package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -0
  59. package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js +20 -0
  60. package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js.map +1 -0
  61. package/dist/esm/next/components/Wizard/index.d.ts +12 -0
  62. package/dist/esm/next/components/Wizard/index.d.ts.map +1 -0
  63. package/dist/esm/next/components/Wizard/index.js +12 -0
  64. package/dist/esm/next/components/Wizard/index.js.map +1 -0
  65. package/dist/esm/next/components/Wizard/types.d.ts +69 -0
  66. package/dist/esm/next/components/Wizard/types.d.ts.map +1 -0
  67. package/dist/esm/next/components/Wizard/types.js +20 -0
  68. package/dist/esm/next/components/Wizard/types.js.map +1 -0
  69. package/dist/esm/next/components/Wizard/utils.d.ts +15 -0
  70. package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -0
  71. package/dist/esm/next/components/Wizard/utils.js +35 -0
  72. package/dist/esm/next/components/Wizard/utils.js.map +1 -0
  73. package/dist/esm/next/components/index.d.ts +1 -1
  74. package/dist/esm/next/components/index.d.ts.map +1 -1
  75. package/dist/esm/next/components/index.js +1 -1
  76. package/dist/esm/next/components/index.js.map +1 -1
  77. package/dist/js/components/LoginPage/LoginFooterItem.d.ts +3 -3
  78. package/dist/js/components/LoginPage/LoginForm.d.ts +18 -18
  79. package/dist/js/components/LoginPage/LoginHeader.d.ts +1 -1
  80. package/dist/js/components/LoginPage/LoginMainBody.d.ts +2 -2
  81. package/dist/js/components/LoginPage/LoginMainFooter.d.ts +5 -5
  82. package/dist/js/components/LoginPage/LoginMainFooterBandItem.d.ts +2 -2
  83. package/dist/js/components/LoginPage/LoginMainFooterLinksItem.d.ts +5 -5
  84. package/dist/js/components/LoginPage/LoginMainHeader.d.ts +6 -4
  85. package/dist/js/components/LoginPage/LoginMainHeader.d.ts.map +1 -1
  86. package/dist/js/components/LoginPage/LoginMainHeader.js +2 -1
  87. package/dist/js/components/LoginPage/LoginMainHeader.js.map +1 -1
  88. package/dist/js/components/LoginPage/LoginPage.d.ts +16 -14
  89. package/dist/js/components/LoginPage/LoginPage.d.ts.map +1 -1
  90. package/dist/js/components/LoginPage/LoginPage.js +2 -2
  91. package/dist/js/components/LoginPage/LoginPage.js.map +1 -1
  92. package/dist/js/next/components/Wizard/Wizard.d.ts +40 -0
  93. package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -0
  94. package/dist/js/next/components/Wizard/Wizard.js +90 -0
  95. package/dist/js/next/components/Wizard/Wizard.js.map +1 -0
  96. package/dist/js/next/components/Wizard/WizardBody.d.ts +20 -0
  97. package/dist/js/next/components/Wizard/WizardBody.d.ts.map +1 -0
  98. package/dist/js/next/components/Wizard/WizardBody.js +12 -0
  99. package/dist/js/next/components/Wizard/WizardBody.js.map +1 -0
  100. package/dist/js/next/components/Wizard/WizardContext.d.ts +49 -0
  101. package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -0
  102. package/dist/js/next/components/Wizard/WizardContext.js +40 -0
  103. package/dist/js/next/components/Wizard/WizardContext.js.map +1 -0
  104. package/dist/js/next/components/Wizard/WizardFooter.d.ts +28 -0
  105. package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -0
  106. package/dist/js/next/components/Wizard/WizardFooter.js +16 -0
  107. package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -0
  108. package/dist/js/next/components/Wizard/WizardHeader.d.ts +21 -0
  109. package/dist/js/next/components/Wizard/WizardHeader.d.ts.map +1 -0
  110. package/dist/js/next/components/Wizard/WizardHeader.js +18 -0
  111. package/dist/js/next/components/Wizard/WizardHeader.js.map +1 -0
  112. package/dist/js/next/components/Wizard/WizardNav.d.ts +15 -0
  113. package/dist/js/next/components/Wizard/WizardNav.d.ts.map +1 -0
  114. package/dist/js/next/components/Wizard/WizardNav.js +18 -0
  115. package/dist/js/next/components/Wizard/WizardNav.js.map +1 -0
  116. package/dist/js/next/components/Wizard/WizardNavItem.d.ts +25 -0
  117. package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -0
  118. package/dist/js/next/components/Wizard/WizardNavItem.js +37 -0
  119. package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -0
  120. package/dist/js/next/components/Wizard/WizardStep.d.ts +20 -0
  121. package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -0
  122. package/dist/js/next/components/Wizard/WizardStep.js +10 -0
  123. package/dist/js/next/components/Wizard/WizardStep.js.map +1 -0
  124. package/dist/js/next/components/Wizard/WizardToggle.d.ts +26 -0
  125. package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -0
  126. package/dist/js/next/components/Wizard/WizardToggle.js +86 -0
  127. package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -0
  128. package/dist/js/next/components/Wizard/hooks/index.d.ts +2 -0
  129. package/dist/js/next/components/Wizard/hooks/index.d.ts.map +1 -0
  130. package/dist/js/next/components/Wizard/hooks/index.js +6 -0
  131. package/dist/js/next/components/Wizard/hooks/index.js.map +1 -0
  132. package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts +8 -0
  133. package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -0
  134. package/dist/js/next/components/Wizard/hooks/useWizardFooter.js +25 -0
  135. package/dist/js/next/components/Wizard/hooks/useWizardFooter.js.map +1 -0
  136. package/dist/js/next/components/Wizard/index.d.ts +12 -0
  137. package/dist/js/next/components/Wizard/index.d.ts.map +1 -0
  138. package/dist/js/next/components/Wizard/index.js +17 -0
  139. package/dist/js/next/components/Wizard/index.js.map +1 -0
  140. package/dist/js/next/components/Wizard/types.d.ts +69 -0
  141. package/dist/js/next/components/Wizard/types.d.ts.map +1 -0
  142. package/dist/js/next/components/Wizard/types.js +29 -0
  143. package/dist/js/next/components/Wizard/types.js.map +1 -0
  144. package/dist/js/next/components/Wizard/utils.d.ts +15 -0
  145. package/dist/js/next/components/Wizard/utils.d.ts.map +1 -0
  146. package/dist/js/next/components/Wizard/utils.js +41 -0
  147. package/dist/js/next/components/Wizard/utils.js.map +1 -0
  148. package/dist/js/next/components/index.d.ts +1 -1
  149. package/dist/js/next/components/index.d.ts.map +1 -1
  150. package/dist/js/next/components/index.js +1 -1
  151. package/dist/js/next/components/index.js.map +1 -1
  152. package/dist/umd/react-core.css +208 -208
  153. package/dist/umd/react-core.js +4 -3
  154. package/dist/umd/react-core.min.js +4 -4
  155. package/package.json +6 -6
  156. package/src/components/Card/examples/Card.md +67 -38
  157. package/src/components/LoginPage/LoginFooterItem.tsx +3 -3
  158. package/src/components/LoginPage/LoginForm.tsx +18 -18
  159. package/src/components/LoginPage/LoginHeader.tsx +1 -1
  160. package/src/components/LoginPage/LoginMainBody.tsx +2 -2
  161. package/src/components/LoginPage/LoginMainFooter.tsx +5 -5
  162. package/src/components/LoginPage/LoginMainFooterBandItem.tsx +2 -2
  163. package/src/components/LoginPage/LoginMainFooterLinksItem.tsx +5 -5
  164. package/src/components/LoginPage/LoginMainHeader.tsx +8 -4
  165. package/src/components/LoginPage/LoginPage.tsx +18 -15
  166. package/src/components/LoginPage/examples/LoginPage.md +8 -0
  167. package/src/components/LoginPage/examples/LoginPageBasic.tsx +0 -1
  168. package/src/components/LoginPage/examples/LoginPageLanguageSelect.tsx +194 -0
  169. package/src/components/LoginPage/examples/LoginPageShowHidePassword.tsx +0 -1
  170. package/src/components/Wizard/examples/Wizard.md +21 -4
  171. package/src/demos/CardDemos.md +4 -0
  172. package/src/next/components/Wizard/Wizard.tsx +184 -0
  173. package/src/next/components/Wizard/WizardBody.tsx +34 -0
  174. package/src/next/components/Wizard/WizardContext.tsx +104 -0
  175. package/src/next/components/Wizard/WizardFooter.tsx +63 -0
  176. package/src/next/components/Wizard/WizardHeader.tsx +53 -0
  177. package/src/next/components/Wizard/WizardNav.tsx +41 -0
  178. package/src/next/components/Wizard/WizardNavItem.tsx +103 -0
  179. package/src/next/components/Wizard/WizardStep.tsx +23 -0
  180. package/src/next/components/Wizard/WizardToggle.tsx +209 -0
  181. package/src/next/components/Wizard/__tests__/Wizard.test.tsx +298 -0
  182. package/src/next/components/Wizard/examples/Wizard.md +125 -0
  183. package/src/next/components/Wizard/examples/WizardBasic.tsx +22 -0
  184. package/src/next/components/Wizard/examples/WizardCustomNav.tsx +46 -0
  185. package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +170 -0
  186. package/src/next/components/Wizard/hooks/index.ts +1 -0
  187. package/src/next/components/Wizard/hooks/useWizardFooter.tsx +22 -0
  188. package/src/next/components/Wizard/index.ts +11 -0
  189. package/src/next/components/Wizard/types.tsx +101 -0
  190. package/src/next/components/Wizard/utils.ts +47 -0
  191. 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.234.2",
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.85.2",
54
- "@patternfly/react-styles": "^4.84.2",
55
- "@patternfly/react-tokens": "^4.86.2",
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.1",
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": "b0e9f5f00090e529aa29d5476b883807fc7a3bb4"
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
- ### Basic
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
- ### With modifiers
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
- ### With image and actions
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 in card head
41
+ ### Header images and actions
30
42
 
31
- ```ts file='./CardHeaderInCardHead.tsx'
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
- ### Only actions in card head (no header/footer)
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
- ```ts file='./CardOnlyActionsInCardHead.tsx'
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
- ### Only image in card head
49
+ Select the "actions hasNoOffset" checkbox in the example below to illustrate this behavior.
40
50
 
41
- ```ts file='./CardOnlyImageInCardHead.tsx'
51
+ ```ts file='./CardWithImageAndActions.tsx'
42
52
  ```
43
53
 
44
- ### With no footer
54
+ ### Title inline with images and actions
45
55
 
46
- ```ts file='./CardWithNoFooter.tsx'
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
- ### With no header
61
+ ### Card header without title
50
62
 
51
- ```ts file='./CardWithNoHeader.tsx'
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 only a body section
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='./CardWithOnlyBodySection.tsx'
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 only a body section that fills
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
- ### Selectable accessibility highlight
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
- This example demonstrates how the `hasSelectableInput` and `onSelectableInputChange` props improve accessibility for selectable cards.
107
+ ### Selectable card accessibility features
77
108
 
78
- 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, it communicates the current selection state as well.
109
+ The following cards demonstrate how the `hasSelectableInput` and `onSelectableInputChange` properties improve accessibility for selectable cards.
79
110
 
80
- By default this input will have an aria-label that corresponds to the title given to the card if using the card title component. If you don't use the card title component in your selectable card, you must pass a custom aria-label for this input using the `selectableInputAriaLabel` prop.
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
- The first card also (by passing an onchange callback to `onSelectableInputChange`) enables the selection/deselection of the associated card by checking/unchecking the checkbox input.
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 second card does not set `hasSelectableInput` to true, so the input is not rendered. It does not communicate to screen reader users that it is selectable or if it is currently selected.
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
- To best understand this example it is encouraged that you navigate both of these cards using a screen reader.
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
- ### With heading element
124
+ ### Expandable cards
92
125
 
93
- ```ts file='./CardWithHeadingElement.tsx'
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
- ### Expandable
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
- ```ts file='./CardExpandableWithIcon.tsx'
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='./CardLegacySelectable.tsx'
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 Link Item */
4
+ /** Content rendered inside the footer link item */
5
5
  children?: React.ReactNode;
6
- /** Additional classes added to the Footer Link Item */
6
+ /** Additional classes added to the footer link item */
7
7
  className?: string;
8
- /** The URL of the Footer Link Item */
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 Login Main Body's Form */
14
+ /** Additional classes added to the login main body's form */
15
15
  className?: string;
16
- /** Flag indicating the Helper Text is visible * */
16
+ /** Flag indicating the helper text is visible * */
17
17
  showHelperText?: boolean;
18
- /** Content displayed in the Helper Text component * */
18
+ /** Content displayed in the helper text component * */
19
19
  helperText?: React.ReactNode;
20
- /** Icon displayed to the left in the Helper Text */
20
+ /** Icon displayed to the left in the helper text */
21
21
  helperTextIcon?: React.ReactNode;
22
- /** Label for the Username Input Field */
22
+ /** Label for the username input field */
23
23
  usernameLabel?: string;
24
- /** Value for the Username */
24
+ /** Value for the username */
25
25
  usernameValue?: string;
26
- /** Function that handles the onChange event for the Username */
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 Username is valid */
28
+ /** Flag indicating if the username is valid */
29
29
  isValidUsername?: boolean;
30
- /** Label for the Password Input Field */
30
+ /** Label for the password input field */
31
31
  passwordLabel?: string;
32
- /** Value for the Password */
32
+ /** Value for the password */
33
33
  passwordValue?: string;
34
- /** Function that handles the onChange event for the Password */
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 Password is valid */
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 Log in Button Input */
44
+ /** Label for the log in button input */
45
45
  loginButtonLabel?: string;
46
- /** Flag indicating if the Login Button is disabled */
46
+ /** Flag indicating if the login button is disabled */
47
47
  isLoginButtonDisabled?: boolean;
48
- /** Function that is called when the Login button is clicked */
48
+ /** Function that is called when the login button is clicked */
49
49
  onLoginButtonClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
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. */
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 Checkbox is checked. */
52
+ /** Flag indicating if the remember me checkbox is checked. */
53
53
  isRememberMeChecked?: boolean;
54
- /** Function that handles the onChange event for the Remember Me Checkbox */
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 Brand component (e.g. <LoginHeader />) */
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 Login Main Body */
6
+ /** Content rendered inside the login main body */
7
7
  children?: React.ReactNode;
8
- /** Additional classes added to the Login Main Body */
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 Login Main Footer */
6
+ /** Additional classes added to the login main footer */
7
7
  className?: string;
8
- /** Content rendered inside the Login Main Footer */
8
+ /** Content rendered inside the login main footer */
9
9
  children?: React.ReactNode;
10
- /** Content rendered inside the Login Main Footer as Social Media Links* */
10
+ /** Content rendered inside the login main footer as social media links* */
11
11
  socialMediaLoginContent?: React.ReactNode;
12
- /** Content rendered inside of Login Main Footer Band to display a sign up for account message */
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 Login Main Footer Band do display a forgot credentials link* */
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 Link Item */
6
+ /** Content rendered inside the footer link item */
7
7
  children?: React.ReactNode;
8
- /** Additional classes added to the Footer Link Item */
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 Link Item */
6
+ /** Content rendered inside the footer link item */
7
7
  children?: React.ReactNode;
8
- /** HREF for Footer Link Item */
8
+ /** HREF for footer link item */
9
9
  href?: string;
10
- /** Target for Footer Link Item */
10
+ /** Target for footer link item */
11
11
  target?: string;
12
- /** Additional classes added to the Footer Link Item */
12
+ /** Additional classes added to the footer link item */
13
13
  className?: string;
14
- /** Component used to render the Footer Link Item */
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 Login Main Header */
7
+ /** Content rendered inside the login main header */
8
8
  children?: React.ReactNode;
9
- /** Additional classes added to the Login Main Header */
9
+ /** Additional classes added to the login main header */
10
10
  className?: string;
11
- /** Title for the Login Main Header */
11
+ /** Title for the login main header */
12
12
  title?: string;
13
- /** Subtitle that contains the Text, URL, and URL Text for the Login Main Header */
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 LoginPage (e.g. <LoginPageForm>) */
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 LoginPage. */
18
+ /** Additional classes added to the login page */
19
19
  className?: string;
20
- /** Attribute that specifies the URL of the brand image for the LoginPage */
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 LoginPage. */
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 LoginPage */
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 LoginPage. */
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 Text Component of the LoginPage */
28
+ /** Content rendered inside of the text component of the login page */
29
29
  textContent?: string;
30
- /** Items rendered inside of the Footer List Component of the LoginPage */
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 Footer List component of the LoginPage. The only current value is'inline' */
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 Login Main Body Header of the LoginPage */
34
+ /** Title for the login main body header of the login page */
35
35
  loginTitle: string;
36
- /** Subtitle for the Login Main Body Header of the LoginPage */
36
+ /** Subtitle for the login main body header of the login page */
37
37
  loginSubtitle?: string;
38
- /** Content rendered inside of Login Main Footer Band to display a sign up for account message */
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 Login Main Footer Band to display a forgot credentials link* */
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 Social Media Login footer section . */
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"