@patternfly/react-core 6.0.0-alpha.30 → 6.0.0-alpha.32

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 (187) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/components/package.json +1 -1
  3. package/deprecated/package.json +1 -1
  4. package/dist/dynamic/components/AboutModal/package.json +1 -1
  5. package/dist/dynamic/components/Accordion/package.json +1 -1
  6. package/dist/dynamic/components/ActionList/package.json +1 -1
  7. package/dist/dynamic/components/Alert/package.json +1 -1
  8. package/dist/dynamic/components/Avatar/package.json +1 -1
  9. package/dist/dynamic/components/BackToTop/package.json +1 -1
  10. package/dist/dynamic/components/Backdrop/package.json +1 -1
  11. package/dist/dynamic/components/BackgroundImage/package.json +1 -1
  12. package/dist/dynamic/components/Badge/package.json +1 -1
  13. package/dist/dynamic/components/Banner/package.json +1 -1
  14. package/dist/dynamic/components/Brand/package.json +1 -1
  15. package/dist/dynamic/components/Breadcrumb/package.json +1 -1
  16. package/dist/dynamic/components/Button/package.json +1 -1
  17. package/dist/dynamic/components/CalendarMonth/package.json +1 -1
  18. package/dist/dynamic/components/Card/package.json +1 -1
  19. package/dist/dynamic/components/Checkbox/package.json +1 -1
  20. package/dist/dynamic/components/Chip/package.json +1 -1
  21. package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
  22. package/dist/dynamic/components/CodeBlock/package.json +1 -1
  23. package/dist/dynamic/components/DataList/package.json +1 -1
  24. package/dist/dynamic/components/DatePicker/package.json +1 -1
  25. package/dist/dynamic/components/DescriptionList/package.json +1 -1
  26. package/dist/dynamic/components/Divider/package.json +1 -1
  27. package/dist/dynamic/components/DragDrop/package.json +1 -1
  28. package/dist/dynamic/components/Drawer/package.json +1 -1
  29. package/dist/dynamic/components/Dropdown/package.json +1 -1
  30. package/dist/dynamic/components/DualListSelector/package.json +1 -1
  31. package/dist/dynamic/components/EmptyState/package.json +1 -1
  32. package/dist/dynamic/components/ExpandableSection/package.json +1 -1
  33. package/dist/dynamic/components/FileUpload/package.json +1 -1
  34. package/dist/dynamic/components/Form/package.json +1 -1
  35. package/dist/dynamic/components/FormSelect/package.json +1 -1
  36. package/dist/dynamic/components/HelperText/package.json +1 -1
  37. package/dist/dynamic/components/Hint/package.json +1 -1
  38. package/dist/dynamic/components/Icon/package.json +1 -1
  39. package/dist/dynamic/components/InputGroup/package.json +1 -1
  40. package/dist/dynamic/components/JumpLinks/package.json +1 -1
  41. package/dist/dynamic/components/Label/package.json +1 -1
  42. package/dist/dynamic/components/List/package.json +1 -1
  43. package/dist/dynamic/components/LoginPage/package.json +1 -1
  44. package/dist/dynamic/components/Masthead/package.json +1 -1
  45. package/dist/dynamic/components/Menu/package.json +1 -1
  46. package/dist/dynamic/components/MenuToggle/package.json +1 -1
  47. package/dist/dynamic/components/Modal/package.json +1 -1
  48. package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
  49. package/dist/dynamic/components/Nav/package.json +1 -1
  50. package/dist/dynamic/components/NotificationBadge/package.json +1 -1
  51. package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
  52. package/dist/dynamic/components/NumberInput/package.json +1 -1
  53. package/dist/dynamic/components/OverflowMenu/package.json +1 -1
  54. package/dist/dynamic/components/Page/package.json +1 -1
  55. package/dist/dynamic/components/Pagination/package.json +1 -1
  56. package/dist/dynamic/components/Panel/package.json +1 -1
  57. package/dist/dynamic/components/Popover/package.json +1 -1
  58. package/dist/dynamic/components/Progress/package.json +1 -1
  59. package/dist/dynamic/components/ProgressStepper/package.json +1 -1
  60. package/dist/dynamic/components/Radio/package.json +1 -1
  61. package/dist/dynamic/components/SearchInput/package.json +1 -1
  62. package/dist/dynamic/components/Select/package.json +1 -1
  63. package/dist/dynamic/components/Sidebar/package.json +1 -1
  64. package/dist/dynamic/components/SimpleList/package.json +1 -1
  65. package/dist/dynamic/components/Skeleton/package.json +1 -1
  66. package/dist/dynamic/components/SkipToContent/package.json +1 -1
  67. package/dist/dynamic/components/Slider/package.json +1 -1
  68. package/dist/dynamic/components/Spinner/package.json +1 -1
  69. package/dist/dynamic/components/Switch/package.json +1 -1
  70. package/dist/dynamic/components/Tabs/package.json +1 -1
  71. package/dist/dynamic/components/Text/package.json +1 -1
  72. package/dist/dynamic/components/TextArea/package.json +1 -1
  73. package/dist/dynamic/components/TextInput/package.json +1 -1
  74. package/dist/dynamic/components/TextInputGroup/package.json +1 -1
  75. package/dist/dynamic/components/Tile/package.json +1 -1
  76. package/dist/dynamic/components/TimePicker/package.json +1 -1
  77. package/dist/dynamic/components/Timestamp/package.json +1 -1
  78. package/dist/dynamic/components/Title/package.json +1 -1
  79. package/dist/dynamic/components/ToggleGroup/package.json +1 -1
  80. package/dist/dynamic/components/Toolbar/package.json +1 -1
  81. package/dist/dynamic/components/Tooltip/package.json +1 -1
  82. package/dist/dynamic/components/TreeView/package.json +1 -1
  83. package/dist/dynamic/components/Truncate/package.json +1 -1
  84. package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
  85. package/dist/dynamic/components/Wizard/package.json +1 -1
  86. package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
  87. package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
  88. package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
  89. package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
  90. package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
  91. package/dist/dynamic/deprecated/components/Select/package.json +1 -1
  92. package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
  93. package/dist/dynamic/deprecated/components/package.json +1 -1
  94. package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
  95. package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
  96. package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
  97. package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
  98. package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
  99. package/dist/dynamic/helpers/constants/package.json +1 -1
  100. package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
  101. package/dist/dynamic/helpers/favorites/package.json +1 -1
  102. package/dist/dynamic/helpers/fileUtils/package.json +1 -1
  103. package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
  104. package/dist/dynamic/helpers/package.json +1 -1
  105. package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
  106. package/dist/dynamic/helpers/typeUtils/package.json +1 -1
  107. package/dist/dynamic/helpers/useInterval/package.json +1 -1
  108. package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
  109. package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
  110. package/dist/dynamic/helpers/util/package.json +1 -1
  111. package/dist/dynamic/layouts/Bullseye/package.json +1 -1
  112. package/dist/dynamic/layouts/Flex/package.json +1 -1
  113. package/dist/dynamic/layouts/Gallery/package.json +1 -1
  114. package/dist/dynamic/layouts/Grid/package.json +1 -1
  115. package/dist/dynamic/layouts/Level/package.json +1 -1
  116. package/dist/dynamic/layouts/Split/package.json +1 -1
  117. package/dist/dynamic/layouts/Stack/package.json +1 -1
  118. package/dist/dynamic/next/components/Modal/package.json +1 -1
  119. package/dist/dynamic/next/components/package.json +1 -1
  120. package/dist/dynamic/styles/package.json +1 -1
  121. package/dist/esm/components/ActionList/ActionList.js +1 -1
  122. package/dist/esm/components/ActionList/ActionList.js.map +1 -1
  123. package/dist/esm/components/ActionList/ActionListGroup.d.ts +2 -0
  124. package/dist/esm/components/ActionList/ActionListGroup.d.ts.map +1 -1
  125. package/dist/esm/components/ActionList/ActionListGroup.js +2 -2
  126. package/dist/esm/components/ActionList/ActionListGroup.js.map +1 -1
  127. package/dist/esm/components/ActionList/ActionListItem.js +1 -1
  128. package/dist/esm/components/ActionList/ActionListItem.js.map +1 -1
  129. package/dist/esm/components/Card/Card.d.ts +2 -16
  130. package/dist/esm/components/Card/Card.d.ts.map +1 -1
  131. package/dist/esm/components/Card/Card.js +3 -45
  132. package/dist/esm/components/Card/Card.js.map +1 -1
  133. package/dist/esm/components/Card/CardHeader.d.ts.map +1 -1
  134. package/dist/esm/components/Card/CardHeader.js +2 -5
  135. package/dist/esm/components/Card/CardHeader.js.map +1 -1
  136. package/dist/esm/components/Card/CardTitle.d.ts.map +1 -1
  137. package/dist/esm/components/Card/CardTitle.js +1 -5
  138. package/dist/esm/components/Card/CardTitle.js.map +1 -1
  139. package/dist/js/components/ActionList/ActionList.js +1 -1
  140. package/dist/js/components/ActionList/ActionList.js.map +1 -1
  141. package/dist/js/components/ActionList/ActionListGroup.d.ts +2 -0
  142. package/dist/js/components/ActionList/ActionListGroup.d.ts.map +1 -1
  143. package/dist/js/components/ActionList/ActionListGroup.js +2 -2
  144. package/dist/js/components/ActionList/ActionListGroup.js.map +1 -1
  145. package/dist/js/components/ActionList/ActionListItem.js +1 -1
  146. package/dist/js/components/ActionList/ActionListItem.js.map +1 -1
  147. package/dist/js/components/Card/Card.d.ts +2 -16
  148. package/dist/js/components/Card/Card.d.ts.map +1 -1
  149. package/dist/js/components/Card/Card.js +3 -45
  150. package/dist/js/components/Card/Card.js.map +1 -1
  151. package/dist/js/components/Card/CardHeader.d.ts.map +1 -1
  152. package/dist/js/components/Card/CardHeader.js +2 -5
  153. package/dist/js/components/Card/CardHeader.js.map +1 -1
  154. package/dist/js/components/Card/CardTitle.d.ts.map +1 -1
  155. package/dist/js/components/Card/CardTitle.js +1 -5
  156. package/dist/js/components/Card/CardTitle.js.map +1 -1
  157. package/dist/umd/react-core.min.js +1 -1
  158. package/helpers/package.json +1 -1
  159. package/layouts/package.json +1 -1
  160. package/next/package.json +1 -1
  161. package/package.json +2 -2
  162. package/src/components/ActionList/ActionList.tsx +1 -1
  163. package/src/components/ActionList/ActionListGroup.tsx +5 -2
  164. package/src/components/ActionList/ActionListItem.tsx +1 -1
  165. package/src/components/ActionList/__tests__/ActionListGroup.test.tsx +8 -2
  166. package/src/components/ActionList/examples/ActionListSingleGroup.tsx +45 -40
  167. package/src/components/ActionList/examples/ActionListWithCancelButton.tsx +12 -10
  168. package/src/components/ActionList/examples/ActionListWithIcons.tsx +44 -13
  169. package/src/components/Card/Card.tsx +6 -82
  170. package/src/components/Card/CardHeader.tsx +2 -6
  171. package/src/components/Card/CardTitle.tsx +1 -7
  172. package/src/components/Card/__tests__/Card.test.tsx +5 -123
  173. package/src/components/Card/__tests__/CardTitle.test.tsx +0 -13
  174. package/src/components/Card/examples/Card.md +17 -34
  175. package/src/components/Card/examples/CardClickable.tsx +62 -44
  176. package/src/components/Card/examples/CardClickableSelectable.tsx +93 -59
  177. package/src/components/Card/examples/CardExpandableWithIcon.tsx +1 -1
  178. package/src/components/Card/examples/CardSecondary.tsx +10 -0
  179. package/src/components/Card/examples/CardSelectable.tsx +62 -45
  180. package/src/components/Card/examples/CardSingleSelectable.tsx +3 -3
  181. package/src/components/Card/examples/CardWithDividers.tsx +14 -0
  182. package/src/components/Card/examples/CardWithImageAndActions.tsx +18 -18
  183. package/src/components/Card/examples/CardWithModifiers.tsx +0 -1
  184. package/src/demos/examples/Card/CardHorizontalSplit.tsx +1 -1
  185. package/src/demos/examples/Tabs/NestedUnindentedTabs.tsx +3 -3
  186. package/src/components/Card/examples/CardDeprecatedSelectable.tsx +0 -127
  187. package/src/components/Card/examples/CardDeprecatedSelectableA11yHighlight.tsx +0 -61
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import { CardTitle } from '../CardTitle';
4
- import { CardContext } from '../Card';
5
4
 
6
5
  describe('CardTitle', () => {
7
6
  test('renders with PatternFly Core styles', () => {
@@ -20,16 +19,4 @@ describe('CardTitle', () => {
20
19
  render(<CardTitle data-testid={testId} />);
21
20
  expect(screen.getByTestId(testId)).toBeInTheDocument();
22
21
  });
23
-
24
- test('calls the registerTitleId function provided by the CardContext with the generated title id', () => {
25
- const mockRegisterTitleId = jest.fn();
26
-
27
- render(
28
- <CardContext.Provider value={{ cardId: 'card', registerTitleId: mockRegisterTitleId }}>
29
- <CardTitle>text</CardTitle>
30
- </CardContext.Provider>
31
- );
32
-
33
- expect(mockRegisterTitleId).toHaveBeenCalledWith('card-title');
34
- });
35
22
  });
@@ -16,8 +16,8 @@ propComponents:
16
16
  ouia: true
17
17
  ---
18
18
 
19
- import pfLogo from '../../assets/pfLogo.svg';
20
- import pfLogoSmall from '../../assets/pf-c-brand--logo-on-sm.svg';
19
+ import pfLogo from '../../assets/PF-HorizontalLogo-Color.svg';
20
+ import pfLogoSmall from '../../assets/PF-IconLogo.svg';
21
21
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
22
22
 
23
23
  ## Examples
@@ -30,6 +30,14 @@ Basic cards typically have a `<CardTitle>`, `<CardBody>` and `<CardFooter>`. You
30
30
 
31
31
  ```
32
32
 
33
+ ### Secondary cards
34
+
35
+ You can apply secondary background color styling to a card by setting the `variant` property to `secondary`.
36
+
37
+ ```ts file='./CardSecondary.tsx'
38
+
39
+ ```
40
+
33
41
  ### Modifiers
34
42
 
35
43
  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.
@@ -43,8 +51,6 @@ Most modifiers can be used in combination with each other, except for `isCompact
43
51
  | Modifier | Description |
44
52
  | ------------ | ------------------------------------------------------------------------------------ |
45
53
  | isCompact | Modifies the card to include compact styling. Should not be used with isLarge. |
46
- | isFlat | Modifies the card to include flat styling. |
47
- | isRounded | Modifies the card to include rounded border styling. |
48
54
  | isLarge | Modifies the card to be large. Should not be used with isCompact. |
49
55
  | isFullHeight | Modifies the card so that it fills the total available height of its container. |
50
56
  | isPlain | Modifies the card to include plain styling, which removes the border and background. |
@@ -145,36 +151,6 @@ When passing interactive content to a clickable and selectable card that is disa
145
151
 
146
152
  ```
147
153
 
148
- ### Selectable cards (deprecated)
149
-
150
- The following example shows a deprecated 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.
151
-
152
- A `tabIndex={0}` is also manually passed to allow the card to be focused and clicked via keyboard.
153
-
154
- ```ts file='./CardDeprecatedSelectable.tsx' isDeprecated
155
-
156
- ```
157
-
158
- ### Selectable card accessibility features (deprecated)
159
-
160
- Note: the following example uses deprecated properties. We recommend using the new `selectableActions` property for the `CardHeader` instead.
161
-
162
- The following cards demonstrate how the `hasSelectableInput` and `onSelectableInputChange` properties improve accessibility for selectable cards.
163
-
164
- 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.
165
-
166
- 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.
167
-
168
- The first card passes an onChange callback to `onSelectableInputChange` to enable the selection/deselection of the associated card via checkbox input.
169
-
170
- The second card does not set `hasSelectableInput` to true, so neither the input nor the selection state is communicated to users of assistive technologies.
171
-
172
- We recommend navigating this example using a screen reader to best understand both cards.
173
-
174
- ```ts file='./CardDeprecatedSelectableA11yHighlight.tsx' isDeprecated
175
-
176
- ```
177
-
178
154
  ### Expandable cards
179
155
 
180
156
  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.
@@ -192,3 +168,10 @@ An image can be placed in the card header to show users an icon beside the expan
192
168
  ```ts file='./CardExpandableWithIcon.tsx'
193
169
 
194
170
  ```
171
+
172
+ ### Card with dividers
173
+ Dividers can be placed between sections of the card.
174
+
175
+ ```ts file='./CardWithDividers.tsx'
176
+
177
+ ```
@@ -1,54 +1,72 @@
1
1
  import React from 'react';
2
- import { Card, CardHeader, CardTitle, CardBody } from '@patternfly/react-core';
2
+ import { Card, CardHeader, CardTitle, CardBody, Checkbox, Gallery } from '@patternfly/react-core';
3
3
 
4
4
  export const CardClickable: React.FunctionComponent = () => {
5
+ const [isSecondary, setIsSecondary] = React.useState<boolean>(false);
6
+
5
7
  const id1 = 'clickable-card-input-1';
6
8
  const id2 = 'clickable-card-input-2';
7
9
  const id3 = 'clickable-card-input-3';
8
10
 
11
+ const toggleVariant = (checked: boolean) => {
12
+ setIsSecondary(checked);
13
+ };
14
+
9
15
  return (
10
- <React.Fragment>
11
- <Card id="clickable-card-example-1" isClickable>
12
- <CardHeader
13
- selectableActions={{
14
- // eslint-disable-next-line no-console
15
- onClickAction: () => console.log(`${id1} clicked`),
16
- selectableActionId: id1,
17
- selectableActionAriaLabelledby: 'clickable-card-example-1',
18
- name: 'clickable-card-example'
19
- }}
20
- >
21
- <CardTitle>First card</CardTitle>
22
- </CardHeader>
23
- <CardBody>This card performs an action on click.</CardBody>
24
- </Card>
25
- <Card id="clickable-card-example-2" isClickable>
26
- <CardHeader
27
- selectableActions={{
28
- to: '#',
29
- selectableActionId: id2,
30
- selectableActionAriaLabelledby: 'clickable-card-example-2',
31
- name: 'clickable-card-example'
32
- }}
33
- >
34
- <CardTitle>Second card</CardTitle>
35
- </CardHeader>
36
- <CardBody>This card can navigate to a link on click.</CardBody>
37
- </Card>
38
- <Card id="clickable-card-example-3" isClickable isDisabled>
39
- <CardHeader
40
- selectableActions={{
41
- // eslint-disable-next-line no-console
42
- onClickAction: () => console.log(`${id3} clicked`),
43
- selectableActionId: id3,
44
- selectableActionAriaLabelledby: 'clickable-card-example-3',
45
- name: 'clickable-card-example'
46
- }}
47
- >
48
- <CardTitle>Third card</CardTitle>
49
- </CardHeader>
50
- <CardBody>This card is clickable but disabled.</CardBody>
51
- </Card>
52
- </React.Fragment>
16
+ <>
17
+ <Checkbox
18
+ label="secondary styling"
19
+ isChecked={isSecondary}
20
+ onChange={(_event, checked) => toggleVariant(checked)}
21
+ aria-label="add secondary styling"
22
+ id="toggle-variant-clickable"
23
+ name="toggle-variant"
24
+ />
25
+ <div style={{ marginTop: '15px' }}>
26
+ <Gallery hasGutter>
27
+ <Card id="clickable-card-example-1" isClickable variant={isSecondary ? 'secondary' : 'default'}>
28
+ <CardHeader
29
+ selectableActions={{
30
+ // eslint-disable-next-line no-console
31
+ onClickAction: () => console.log(`${id1} clicked`),
32
+ selectableActionId: id1,
33
+ selectableActionAriaLabelledby: 'clickable-card-example-1',
34
+ name: 'clickable-card-example'
35
+ }}
36
+ >
37
+ <CardTitle>First card</CardTitle>
38
+ </CardHeader>
39
+ <CardBody>This card performs an action on click.</CardBody>
40
+ </Card>
41
+ <Card id="clickable-card-example-2" isClickable variant={isSecondary ? 'secondary' : 'default'}>
42
+ <CardHeader
43
+ selectableActions={{
44
+ to: '#',
45
+ selectableActionId: id2,
46
+ selectableActionAriaLabelledby: 'clickable-card-example-2',
47
+ name: 'clickable-card-example'
48
+ }}
49
+ >
50
+ <CardTitle>Second card</CardTitle>
51
+ </CardHeader>
52
+ <CardBody>This card can navigate to a link on click.</CardBody>
53
+ </Card>
54
+ <Card id="clickable-card-example-3" isClickable isDisabled variant={isSecondary ? 'secondary' : 'default'}>
55
+ <CardHeader
56
+ selectableActions={{
57
+ // eslint-disable-next-line no-console
58
+ onClickAction: () => console.log(`${id3} clicked`),
59
+ selectableActionId: id3,
60
+ selectableActionAriaLabelledby: 'clickable-card-example-3',
61
+ name: 'clickable-card-example'
62
+ }}
63
+ >
64
+ <CardTitle>Third card</CardTitle>
65
+ </CardHeader>
66
+ <CardBody>This card is clickable but disabled.</CardBody>
67
+ </Card>
68
+ </Gallery>
69
+ </div>
70
+ </>
53
71
  );
54
72
  };
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
- import { Card, CardHeader, CardTitle, CardBody, Button } from '@patternfly/react-core';
2
+ import { Card, CardHeader, CardTitle, CardBody, Button, Checkbox, Gallery } from '@patternfly/react-core';
3
3
 
4
4
  export const CardClickable: React.FunctionComponent = () => {
5
5
  const [isChecked1, setIsChecked1] = React.useState(false);
6
6
  const [isChecked2, setIsChecked2] = React.useState(false);
7
7
  const [isChecked3, setIsChecked3] = React.useState(false);
8
8
  const [isSelected1, setIsSelected1] = React.useState(false);
9
+ const [isSecondary, setIsSecondary] = React.useState<boolean>(false);
9
10
 
10
11
  const id1 = 'clickable-selectable-card-input-1';
11
12
  const id2 = 'clickable-selectable-card-input-2';
@@ -31,64 +32,97 @@ export const CardClickable: React.FunctionComponent = () => {
31
32
  }
32
33
  };
33
34
 
35
+ const toggleVariant = (checked: boolean) => {
36
+ setIsSecondary(checked);
37
+ };
38
+
34
39
  return (
35
- <React.Fragment>
36
- <Card id="clickable-selectable-card-example-1" isClickable isSelectable isSelected={isSelected1}>
37
- <CardHeader
38
- selectableActions={{
39
- selectableActionId: id1,
40
- selectableActionAriaLabelledby: 'clickable-selectable-card-example-1',
41
- name: id1,
42
- isChecked: isChecked1,
43
- onChange
44
- }}
45
- >
46
- <CardTitle>
47
- <Button variant="link" isInline onClick={onClick}>
48
- First card
49
- </Button>
50
- </CardTitle>
51
- </CardHeader>
52
- <CardBody>This card performs an action upon clicking the card title and is selectable.</CardBody>
53
- </Card>
54
- <Card id="clickable-selectable-card-example-2" isClickable isSelectable>
55
- <CardHeader
56
- selectableActions={{
57
- selectableActionId: id2,
58
- selectableActionAriaLabelledby: 'clickable-selectable-card-example-2',
59
- name: id2,
60
- isChecked: isChecked2,
61
- onChange
62
- }}
63
- >
64
- <CardTitle>Second Card</CardTitle>
65
- </CardHeader>
66
- <CardBody>
67
- This card is selectable and has a link in the card body that navigates to{' '}
68
- <Button variant="link" isInline component="a" href="#">
69
- Patternfly
70
- </Button>
71
- .
72
- </CardBody>
73
- </Card>
74
- <Card id="clickable-selectable-card-example-3" isClickable isSelectable isDisabled>
75
- <CardHeader
76
- selectableActions={{
77
- selectableActionId: id3,
78
- selectableActionAriaLabelledby: 'clickable-selectable-card-example-3',
79
- name: id3,
80
- isChecked: isChecked3,
81
- onChange
82
- }}
83
- >
84
- <CardTitle>
85
- <Button isDisabled variant="link" isInline component="a" href="https://www.patternfly.org/">
86
- Third card
87
- </Button>
88
- </CardTitle>
89
- </CardHeader>
90
- <CardBody>This card is clickable and selectable, but disabled.</CardBody>
91
- </Card>
92
- </React.Fragment>
40
+ <>
41
+ <Checkbox
42
+ label="secondary styling"
43
+ isChecked={isSecondary}
44
+ onChange={(_event, checked) => toggleVariant(checked)}
45
+ aria-label="add secondary styling"
46
+ id="toggle-variant-clickable-selectable"
47
+ name="toggle-variant"
48
+ />
49
+ <div style={{ marginTop: '15px' }}>
50
+ <Gallery hasGutter>
51
+ <Card
52
+ id="clickable-selectable-card-example-1"
53
+ isClickable
54
+ isSelectable
55
+ isSelected={isSelected1}
56
+ variant={isSecondary ? 'secondary' : 'default'}
57
+ >
58
+ <CardHeader
59
+ selectableActions={{
60
+ selectableActionId: id1,
61
+ selectableActionAriaLabelledby: 'clickable-selectable-card-example-1',
62
+ name: id1,
63
+ isChecked: isChecked1,
64
+ onChange
65
+ }}
66
+ >
67
+ <CardTitle>
68
+ <Button variant="link" isInline onClick={onClick}>
69
+ First card
70
+ </Button>
71
+ </CardTitle>
72
+ </CardHeader>
73
+ <CardBody>This card performs an action upon clicking the card title and is selectable.</CardBody>
74
+ </Card>
75
+ <Card
76
+ id="clickable-selectable-card-example-2"
77
+ isClickable
78
+ isSelectable
79
+ variant={isSecondary ? 'secondary' : 'default'}
80
+ >
81
+ <CardHeader
82
+ selectableActions={{
83
+ selectableActionId: id2,
84
+ selectableActionAriaLabelledby: 'clickable-selectable-card-example-2',
85
+ name: id2,
86
+ isChecked: isChecked2,
87
+ onChange
88
+ }}
89
+ >
90
+ <CardTitle>Second Card</CardTitle>
91
+ </CardHeader>
92
+ <CardBody>
93
+ This card is selectable and has a link in the card body that navigates to{' '}
94
+ <Button variant="link" isInline component="a" href="#">
95
+ Patternfly
96
+ </Button>
97
+ .
98
+ </CardBody>
99
+ </Card>
100
+ <Card
101
+ id="clickable-selectable-card-example-3"
102
+ isClickable
103
+ isSelectable
104
+ isDisabled
105
+ variant={isSecondary ? 'secondary' : 'default'}
106
+ >
107
+ <CardHeader
108
+ selectableActions={{
109
+ selectableActionId: id3,
110
+ selectableActionAriaLabelledby: 'clickable-selectable-card-example-3',
111
+ name: id3,
112
+ isChecked: isChecked3,
113
+ onChange
114
+ }}
115
+ >
116
+ <CardTitle>
117
+ <Button isDisabled variant="link" isInline component="a" href="https://www.patternfly.org/">
118
+ Third card
119
+ </Button>
120
+ </CardTitle>
121
+ </CardHeader>
122
+ <CardBody>This card is clickable and selectable, but disabled.</CardBody>
123
+ </Card>
124
+ </Gallery>
125
+ </div>
126
+ </>
93
127
  );
94
128
  };
@@ -13,7 +13,7 @@ import {
13
13
  MenuToggle,
14
14
  MenuToggleElement
15
15
  } from '@patternfly/react-core';
16
- import pfLogoSmall from '../../assets/pf-c-brand--logo-on-sm.svg';
16
+ import pfLogoSmall from '../../PF-IconLogo.svg';
17
17
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
18
18
 
19
19
  export const CardExpandableWithIcon: React.FunctionComponent = () => {
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Card, CardTitle, CardBody, CardFooter } from '@patternfly/react-core';
3
+
4
+ export const CardSecondary: React.FunctionComponent = () => (
5
+ <Card ouiaId="SecondaryCard" variant="secondary">
6
+ <CardTitle>Title</CardTitle>
7
+ <CardBody>Body</CardBody>
8
+ <CardFooter>Footer</CardFooter>
9
+ </Card>
10
+ );
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
- import { Card, CardHeader, CardTitle, CardBody } from '@patternfly/react-core';
2
+ import { Card, CardHeader, CardTitle, CardBody, Checkbox, Gallery } from '@patternfly/react-core';
3
3
 
4
4
  export const SelectableCard: React.FunctionComponent = () => {
5
5
  const [isChecked1, setIsChecked1] = React.useState(false);
6
6
  const [isChecked2, setIsChecked2] = React.useState(false);
7
7
  const [isChecked3, setIsChecked3] = React.useState(false);
8
+ const [isSecondary, setIsSecondary] = React.useState<boolean>(false);
8
9
 
9
10
  const id1 = 'selectable-card-input-1';
10
11
  const id2 = 'selectable-card-input-2';
@@ -26,50 +27,66 @@ export const SelectableCard: React.FunctionComponent = () => {
26
27
  }
27
28
  };
28
29
 
30
+ const toggleVariant = (checked: boolean) => {
31
+ setIsSecondary(checked);
32
+ };
33
+
29
34
  return (
30
- <React.Fragment>
31
- <Card id="selectable-card-example-1" isSelectable>
32
- <CardHeader
33
- selectableActions={{
34
- selectableActionId: id1,
35
- selectableActionAriaLabelledby: 'selectable-card-example-1',
36
- name: id1,
37
- isChecked: isChecked1,
38
- onChange
39
- }}
40
- >
41
- <CardTitle>First card</CardTitle>
42
- </CardHeader>
43
- <CardBody>This card is selectable.</CardBody>
44
- </Card>
45
- <Card id="selectable-card-example-2" isSelectable>
46
- <CardHeader
47
- selectableActions={{
48
- selectableActionId: id2,
49
- selectableActionAriaLabelledby: 'selectable-card-example-2',
50
- name: id2,
51
- isChecked: isChecked2,
52
- onChange
53
- }}
54
- >
55
- <CardTitle>Second card</CardTitle>
56
- </CardHeader>
57
- <CardBody>This card is selectable.</CardBody>
58
- </Card>
59
- <Card id="selectable-card-example-3" isSelectable isDisabled>
60
- <CardHeader
61
- selectableActions={{
62
- selectableActionId: id3,
63
- selectableActionAriaLabelledby: 'selectable-card-example-3',
64
- name: id3,
65
- isChecked: isChecked3,
66
- onChange
67
- }}
68
- >
69
- <CardTitle>Third card</CardTitle>
70
- </CardHeader>
71
- <CardBody>This card is selectable but disabled.</CardBody>
72
- </Card>
73
- </React.Fragment>
35
+ <>
36
+ <Checkbox
37
+ label="secondary styling"
38
+ isChecked={isSecondary}
39
+ onChange={(_event, checked) => toggleVariant(checked)}
40
+ aria-label="add secondary styling"
41
+ id="toggle-variant-selectable"
42
+ name="toggle-variant"
43
+ />
44
+ <div style={{ marginTop: '15px' }}>
45
+ <Gallery hasGutter>
46
+ <Card id="selectable-card-example-1" isSelectable variant={isSecondary ? 'secondary' : 'default'}>
47
+ <CardHeader
48
+ selectableActions={{
49
+ selectableActionId: id1,
50
+ selectableActionAriaLabelledby: 'selectable-card-example-1',
51
+ name: id1,
52
+ isChecked: isChecked1,
53
+ onChange
54
+ }}
55
+ >
56
+ <CardTitle>First card</CardTitle>
57
+ </CardHeader>
58
+ <CardBody>This card is selectable.</CardBody>
59
+ </Card>
60
+ <Card id="selectable-card-example-2" isSelectable variant={isSecondary ? 'secondary' : 'default'}>
61
+ <CardHeader
62
+ selectableActions={{
63
+ selectableActionId: id2,
64
+ selectableActionAriaLabelledby: 'selectable-card-example-2',
65
+ name: id2,
66
+ isChecked: isChecked2,
67
+ onChange
68
+ }}
69
+ >
70
+ <CardTitle>Second card</CardTitle>
71
+ </CardHeader>
72
+ <CardBody>This card is selectable.</CardBody>
73
+ </Card>
74
+ <Card id="selectable-card-example-3" isSelectable isDisabled variant={isSecondary ? 'secondary' : 'default'}>
75
+ <CardHeader
76
+ selectableActions={{
77
+ selectableActionId: id3,
78
+ selectableActionAriaLabelledby: 'selectable-card-example-3',
79
+ name: id3,
80
+ isChecked: isChecked3,
81
+ onChange
82
+ }}
83
+ >
84
+ <CardTitle>Third card</CardTitle>
85
+ </CardHeader>
86
+ <CardBody>This card is selectable but disabled.</CardBody>
87
+ </Card>
88
+ </Gallery>
89
+ </div>
90
+ </>
74
91
  );
75
92
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Card, CardHeader, CardTitle, CardBody } from '@patternfly/react-core';
2
+ import { Card, CardHeader, CardTitle, CardBody, Gallery } from '@patternfly/react-core';
3
3
 
4
4
  export const SingleSelectableCard: React.FunctionComponent = () => {
5
5
  const id1 = 'single-selectable-card-input-1';
@@ -7,7 +7,7 @@ export const SingleSelectableCard: React.FunctionComponent = () => {
7
7
  const id3 = 'single-selectable-card-input-3';
8
8
 
9
9
  return (
10
- <React.Fragment>
10
+ <Gallery hasGutter>
11
11
  <Card id="single-selectable-card-example-1" isSelectable>
12
12
  <CardHeader
13
13
  selectableActions={{
@@ -47,6 +47,6 @@ export const SingleSelectableCard: React.FunctionComponent = () => {
47
47
  </CardHeader>
48
48
  <CardBody>This card is single selectable but disabled.</CardBody>
49
49
  </Card>
50
- </React.Fragment>
50
+ </Gallery>
51
51
  );
52
52
  };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Card, CardTitle, CardBody, CardFooter, Divider } from '@patternfly/react-core';
3
+
4
+ export const CardWithDividers: React.FunctionComponent = () => (
5
+ <Card ouiaId="CardWithDividers">
6
+ <CardTitle>Title</CardTitle>
7
+ <Divider />
8
+ <CardBody>Body</CardBody>
9
+ <Divider />
10
+ <CardBody>Body</CardBody>
11
+ <Divider />
12
+ <CardFooter>Footer</CardFooter>
13
+ </Card>
14
+ );
@@ -15,7 +15,7 @@ import {
15
15
  Divider
16
16
  } from '@patternfly/react-core';
17
17
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
18
- import pfLogo from '../../assets/pfLogo.svg';
18
+ import pfLogo from '../../assets/PF-HorizontalLogo-Color.svg';
19
19
 
20
20
  export const CardWithImageAndActions: React.FunctionComponent = () => {
21
21
  const [isOpen, setIsOpen] = React.useState<boolean>(false);
@@ -85,23 +85,23 @@ export const CardWithImageAndActions: React.FunctionComponent = () => {
85
85
 
86
86
  return (
87
87
  <>
88
- <Card>
89
- <CardHeader actions={{ actions: headerActions, hasNoOffset }}>
90
- <Brand src={pfLogo} alt="PatternFly logo" style={{ width: '300px' }} />
91
- </CardHeader>
92
- <CardTitle>Title</CardTitle>
93
- <CardBody>Body</CardBody>
94
- <CardFooter>Footer</CardFooter>
95
- </Card>
96
- <div style={{ marginTop: '20px' }}>
97
- <Checkbox
98
- label="actions hasNoOffset"
99
- isChecked={hasNoOffset}
100
- onChange={(_event, checked) => toggleOffset(checked)}
101
- aria-label="remove actions offset"
102
- id="toggle-actions-offset"
103
- name="toggle-actions-offset"
104
- />
88
+ <Checkbox
89
+ label="actions hasNoOffset"
90
+ isChecked={hasNoOffset}
91
+ onChange={(_event, checked) => toggleOffset(checked)}
92
+ aria-label="remove actions offset"
93
+ id="toggle-actions-offset"
94
+ name="toggle-actions-offset"
95
+ />
96
+ <div style={{ marginTop: '15px' }}>
97
+ <Card>
98
+ <CardHeader actions={{ actions: headerActions, hasNoOffset }}>
99
+ <Brand src={pfLogo} alt="PatternFly logo" style={{ width: '300px' }} />
100
+ </CardHeader>
101
+ <CardTitle>Title</CardTitle>
102
+ <CardBody>Body</CardBody>
103
+ <CardFooter>Footer</CardFooter>
104
+ </Card>
105
105
  </div>
106
106
  </>
107
107
  );
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { Card, CardTitle, CardBody, CardFooter, Checkbox } from '@patternfly/react-core';
3
3
 
4
4
  export const CardWithModifiers: React.FunctionComponent = () => {
5
- // TODO: Update with issue #9991 removed isFlat and isRounded
6
5
  const mods = ['isCompact', 'isLarge', 'isFullHeight', 'isPlain'];
7
6
  const [modifiers, setModifiers] = React.useState({});
8
7
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Card, CardTitle, CardBody, CardFooter, Grid, GridItem, Button } from '@patternfly/react-core';
3
3
 
4
4
  export const CardHorizontalSplitDemo: React.FunctionComponent = () => (
5
- <Card id="card-demo-horizontal-split-example" isFlat>
5
+ <Card id="card-demo-horizontal-split-example">
6
6
  <Grid md={6}>
7
7
  <GridItem
8
8
  style={{