@patternfly/react-core 6.0.0-alpha.30 → 6.0.0-alpha.31
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 +6 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/Chip/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/DragDrop/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/Text/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/Tile/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
- package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
- package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
- package/dist/dynamic/deprecated/components/Select/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/favorites/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/next/components/Modal/package.json +1 -1
- package/dist/dynamic/next/components/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/esm/components/Card/Card.d.ts +2 -16
- package/dist/esm/components/Card/Card.d.ts.map +1 -1
- package/dist/esm/components/Card/Card.js +3 -45
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/esm/components/Card/CardHeader.js +2 -5
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/CardTitle.d.ts.map +1 -1
- package/dist/esm/components/Card/CardTitle.js +1 -5
- package/dist/esm/components/Card/CardTitle.js.map +1 -1
- package/dist/js/components/Card/Card.d.ts +2 -16
- package/dist/js/components/Card/Card.d.ts.map +1 -1
- package/dist/js/components/Card/Card.js +3 -45
- package/dist/js/components/Card/Card.js.map +1 -1
- package/dist/js/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/js/components/Card/CardHeader.js +2 -5
- package/dist/js/components/Card/CardHeader.js.map +1 -1
- package/dist/js/components/Card/CardTitle.d.ts.map +1 -1
- package/dist/js/components/Card/CardTitle.js +1 -5
- package/dist/js/components/Card/CardTitle.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/Card/Card.tsx +6 -82
- package/src/components/Card/CardHeader.tsx +2 -6
- package/src/components/Card/CardTitle.tsx +1 -7
- package/src/components/Card/__tests__/Card.test.tsx +5 -123
- package/src/components/Card/__tests__/CardTitle.test.tsx +0 -13
- package/src/components/Card/examples/Card.md +17 -34
- package/src/components/Card/examples/CardClickable.tsx +62 -44
- package/src/components/Card/examples/CardClickableSelectable.tsx +93 -59
- package/src/components/Card/examples/CardExpandableWithIcon.tsx +1 -1
- package/src/components/Card/examples/CardSecondary.tsx +10 -0
- package/src/components/Card/examples/CardSelectable.tsx +62 -45
- package/src/components/Card/examples/CardSingleSelectable.tsx +3 -3
- package/src/components/Card/examples/CardWithDividers.tsx +14 -0
- package/src/components/Card/examples/CardWithImageAndActions.tsx +18 -18
- package/src/components/Card/examples/CardWithModifiers.tsx +0 -1
- package/src/demos/examples/Card/CardHorizontalSplit.tsx +1 -1
- package/src/demos/examples/Tabs/NestedUnindentedTabs.tsx +3 -3
- package/src/components/Card/examples/CardDeprecatedSelectable.tsx +0 -127
- package/src/components/Card/examples/CardDeprecatedSelectableA11yHighlight.tsx +0 -61
|
@@ -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
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
>
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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 '../../
|
|
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
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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/
|
|
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
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<div style={{ marginTop: '
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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"
|
|
5
|
+
<Card id="card-demo-horizontal-split-example">
|
|
6
6
|
<Grid md={6}>
|
|
7
7
|
<GridItem
|
|
8
8
|
style={{
|
|
@@ -70,20 +70,20 @@ export const NestedUnindentedTabs: React.FunctionComponent = () => {
|
|
|
70
70
|
</TextContent>
|
|
71
71
|
</GridItem>
|
|
72
72
|
<Grid md={6} xl2={3} hasGutter>
|
|
73
|
-
<Card
|
|
73
|
+
<Card component="div">
|
|
74
74
|
<CardTitle>Check system requirements</CardTitle>
|
|
75
75
|
<CardBody>
|
|
76
76
|
Your physical or virtual machine should meet the <a href="#">system requirement</a>.
|
|
77
77
|
</CardBody>
|
|
78
78
|
</Card>
|
|
79
|
-
<Card
|
|
79
|
+
<Card component="div">
|
|
80
80
|
<CardTitle>Download an installation ISO image</CardTitle>
|
|
81
81
|
<CardBody>
|
|
82
82
|
{' '}
|
|
83
83
|
<a href="#">Download</a> the binary DVD ISO.
|
|
84
84
|
</CardBody>
|
|
85
85
|
</Card>
|
|
86
|
-
<Card
|
|
86
|
+
<Card component="div">
|
|
87
87
|
<CardTitle>Create a bootable installation media</CardTitle>
|
|
88
88
|
<CardBody>
|
|
89
89
|
{' '}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Card,
|
|
4
|
-
CardHeader,
|
|
5
|
-
CardTitle,
|
|
6
|
-
CardBody,
|
|
7
|
-
Dropdown,
|
|
8
|
-
DropdownList,
|
|
9
|
-
DropdownItem,
|
|
10
|
-
MenuToggle,
|
|
11
|
-
MenuToggleElement,
|
|
12
|
-
Divider
|
|
13
|
-
} from '@patternfly/react-core';
|
|
14
|
-
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
15
|
-
|
|
16
|
-
export const CardLegacySelectable: React.FunctionComponent = () => {
|
|
17
|
-
const [selected, setSelected] = React.useState<string>('');
|
|
18
|
-
const [isKebabOpen, setIsKebabOpen] = React.useState<boolean>(false);
|
|
19
|
-
|
|
20
|
-
const onKeyDown = (event: React.KeyboardEvent) => {
|
|
21
|
-
if (event.target !== event.currentTarget) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (['Enter', ' '].includes(event.key)) {
|
|
25
|
-
event.preventDefault();
|
|
26
|
-
const newSelected = event.currentTarget.id === selected ? '' : event.currentTarget.id;
|
|
27
|
-
setSelected(newSelected);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const onClick = (event: React.MouseEvent) => {
|
|
32
|
-
const newSelected = event.currentTarget.id === selected ? '' : event.currentTarget.id;
|
|
33
|
-
setSelected(newSelected);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const onChange = (_event: React.FormEvent<HTMLInputElement>, labelledById: string) => {
|
|
37
|
-
const newSelected = labelledById === selected ? '' : labelledById;
|
|
38
|
-
setSelected(newSelected);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const onToggle = (event: React.MouseEvent) => {
|
|
42
|
-
event?.stopPropagation();
|
|
43
|
-
setIsKebabOpen(!isKebabOpen);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const onSelect = (event: React.MouseEvent | undefined) => {
|
|
47
|
-
event?.stopPropagation();
|
|
48
|
-
setIsKebabOpen(!isKebabOpen);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const dropdownItems = (
|
|
52
|
-
<>
|
|
53
|
-
<DropdownItem key="action">Action</DropdownItem>
|
|
54
|
-
{/* Prevent default onClick functionality for example purposes */}
|
|
55
|
-
<DropdownItem key="link" to="#" onClick={(event: any) => event.preventDefault()}>
|
|
56
|
-
Link
|
|
57
|
-
</DropdownItem>
|
|
58
|
-
<DropdownItem key="disabled action" isDisabled>
|
|
59
|
-
Disabled Action
|
|
60
|
-
</DropdownItem>
|
|
61
|
-
<DropdownItem key="disabled link" isDisabled to="#" onClick={(event: any) => event.preventDefault()}>
|
|
62
|
-
Disabled Link
|
|
63
|
-
</DropdownItem>
|
|
64
|
-
<Divider component="li" key="separator" />
|
|
65
|
-
<DropdownItem key="separated action">Separated Action</DropdownItem>
|
|
66
|
-
<DropdownItem key="separated link" to="#" onClick={(event: any) => event.preventDefault()}>
|
|
67
|
-
Separated Link
|
|
68
|
-
</DropdownItem>
|
|
69
|
-
</>
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
const headerActions = (
|
|
73
|
-
<>
|
|
74
|
-
<Dropdown
|
|
75
|
-
onSelect={onSelect}
|
|
76
|
-
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
77
|
-
<MenuToggle
|
|
78
|
-
ref={toggleRef}
|
|
79
|
-
isExpanded={isKebabOpen}
|
|
80
|
-
onClick={onToggle}
|
|
81
|
-
variant="plain"
|
|
82
|
-
aria-label="Card legacy selectable example kebab toggle"
|
|
83
|
-
>
|
|
84
|
-
<EllipsisVIcon aria-hidden="true" />
|
|
85
|
-
</MenuToggle>
|
|
86
|
-
)}
|
|
87
|
-
isOpen={isKebabOpen}
|
|
88
|
-
onOpenChange={(isOpen: boolean) => setIsKebabOpen(isOpen)}
|
|
89
|
-
>
|
|
90
|
-
<DropdownList>{dropdownItems}</DropdownList>
|
|
91
|
-
</Dropdown>
|
|
92
|
-
</>
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<>
|
|
97
|
-
<Card
|
|
98
|
-
id="legacy-first-card"
|
|
99
|
-
onKeyDown={onKeyDown}
|
|
100
|
-
onClick={onClick}
|
|
101
|
-
onSelectableInputChange={onChange}
|
|
102
|
-
isSelectable
|
|
103
|
-
isSelected={selected === 'legacy-first-card'}
|
|
104
|
-
hasSelectableInput
|
|
105
|
-
tabIndex={0}
|
|
106
|
-
>
|
|
107
|
-
<CardHeader actions={{ actions: headerActions }} />
|
|
108
|
-
<CardTitle>First legacy selectable card</CardTitle>
|
|
109
|
-
<CardBody>This is a selectable card. Click me to select me. Click again to deselect me.</CardBody>
|
|
110
|
-
</Card>
|
|
111
|
-
<br />
|
|
112
|
-
<Card
|
|
113
|
-
id="legacy-second-card"
|
|
114
|
-
onKeyDown={onKeyDown}
|
|
115
|
-
onClick={onClick}
|
|
116
|
-
onSelectableInputChange={onChange}
|
|
117
|
-
isSelectable
|
|
118
|
-
isSelected={selected === 'legacy-second-card'}
|
|
119
|
-
hasSelectableInput
|
|
120
|
-
tabIndex={0}
|
|
121
|
-
>
|
|
122
|
-
<CardTitle>Second legacy selectable card</CardTitle>
|
|
123
|
-
<CardBody>This is a selectable card. Click me to select me. Click again to deselect me.</CardBody>
|
|
124
|
-
</Card>
|
|
125
|
-
</>
|
|
126
|
-
);
|
|
127
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Card, CardTitle, CardBody } from '@patternfly/react-core';
|
|
3
|
-
|
|
4
|
-
export const CardLegacySelectableA11yHighlight: React.FunctionComponent = () => {
|
|
5
|
-
const [selected, setSelected] = React.useState<string>('');
|
|
6
|
-
|
|
7
|
-
const onKeyDown = (event: React.KeyboardEvent) => {
|
|
8
|
-
if (event.target !== event.currentTarget) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
if ([' ', 'Enter'].includes(event.key)) {
|
|
12
|
-
event.preventDefault();
|
|
13
|
-
const newSelected = event.currentTarget.id === selected ? '' : event.currentTarget.id;
|
|
14
|
-
setSelected(newSelected);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const onClick = (event: React.MouseEvent) => {
|
|
19
|
-
const newSelected = event.currentTarget.id === selected ? '' : event.currentTarget.id;
|
|
20
|
-
setSelected(newSelected);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const onChange = (_event: React.FormEvent<HTMLInputElement>, labelledById: string) => {
|
|
24
|
-
const newSelected = labelledById === selected ? '' : labelledById;
|
|
25
|
-
setSelected(newSelected);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<React.Fragment>
|
|
30
|
-
<Card
|
|
31
|
-
id="a11y-selectable-first-card"
|
|
32
|
-
onKeyDown={onKeyDown}
|
|
33
|
-
onClick={onClick}
|
|
34
|
-
hasSelectableInput
|
|
35
|
-
onSelectableInputChange={onChange}
|
|
36
|
-
isSelectableRaised
|
|
37
|
-
isSelected={selected === 'a11y-selectable-first-card'}
|
|
38
|
-
>
|
|
39
|
-
<CardTitle>Selectable card with proper accessibility considerations</CardTitle>
|
|
40
|
-
<CardBody>
|
|
41
|
-
When using a screen reader a checkbox will become navigable that indicates this card is selectable and
|
|
42
|
-
communicate if it is currently selected.
|
|
43
|
-
</CardBody>
|
|
44
|
-
</Card>
|
|
45
|
-
<br />
|
|
46
|
-
<Card
|
|
47
|
-
id="a11y-selectable-second-card"
|
|
48
|
-
onKeyDown={onKeyDown}
|
|
49
|
-
onClick={onClick}
|
|
50
|
-
isSelectableRaised
|
|
51
|
-
isSelected={selected === 'a11y-selectable-second-card'}
|
|
52
|
-
>
|
|
53
|
-
<CardTitle>Selectable card without proper accessibility considerations</CardTitle>
|
|
54
|
-
<CardBody>
|
|
55
|
-
When using a screen reader there are no indications that this card is selectable or if it is currently
|
|
56
|
-
selected.
|
|
57
|
-
</CardBody>
|
|
58
|
-
</Card>
|
|
59
|
-
</React.Fragment>
|
|
60
|
-
);
|
|
61
|
-
};
|