@patternfly/react-core 6.0.0-alpha.5 → 6.0.0-alpha.7
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 +106 -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/package.json +1 -1
- package/dist/esm/components/Banner/Banner.d.ts +16 -3
- package/dist/esm/components/Banner/Banner.d.ts.map +1 -1
- package/dist/esm/components/Banner/Banner.js +10 -2
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/List/ListItem.js +1 -1
- package/dist/esm/components/List/ListItem.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts +2 -0
- package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +3 -2
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +1 -1
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Title/Title.d.ts.map +1 -1
- package/dist/esm/components/Title/Title.js +2 -11
- package/dist/esm/components/Title/Title.js.map +1 -1
- package/dist/esm/demos/DashboardHeader.js +1 -1
- package/dist/esm/demos/DashboardHeader.js.map +1 -1
- package/dist/js/components/Banner/Banner.d.ts +16 -3
- package/dist/js/components/Banner/Banner.d.ts.map +1 -1
- package/dist/js/components/Banner/Banner.js +10 -2
- package/dist/js/components/Banner/Banner.js.map +1 -1
- package/dist/js/components/List/ListItem.js +1 -1
- package/dist/js/components/List/ListItem.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts +2 -0
- package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.js +3 -2
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/Popover/Popover.js +1 -1
- package/dist/js/components/Popover/Popover.js.map +1 -1
- package/dist/js/components/Title/Title.d.ts.map +1 -1
- package/dist/js/components/Title/Title.js +2 -11
- package/dist/js/components/Title/Title.js.map +1 -1
- package/dist/js/demos/DashboardHeader.js +2 -2
- package/dist/js/demos/DashboardHeader.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 +5 -5
- package/src/components/Banner/Banner.tsx +41 -18
- package/src/components/Banner/__tests__/Banner.test.tsx +56 -11
- package/src/components/Banner/examples/Banner.md +4 -2
- package/src/components/Banner/examples/BannerBasic.tsx +12 -4
- package/src/components/Banner/examples/BannerStatus.tsx +13 -13
- package/src/components/List/ListItem.tsx +1 -1
- package/src/components/List/__tests__/Generated/__snapshots__/ListItem.test.tsx.snap +3 -1
- package/src/components/List/__tests__/__snapshots__/List.test.tsx.snap +57 -15
- package/src/components/Masthead/examples/Masthead.md +8 -146
- package/src/components/Masthead/examples/MastheadBasic.tsx +19 -0
- package/src/components/Masthead/examples/MastheadBasicMixedContent.tsx +37 -0
- package/src/components/Masthead/examples/MastheadDisplayInline.tsx +19 -0
- package/src/components/Masthead/examples/MastheadDisplayStack.tsx +19 -0
- package/src/components/Masthead/examples/MastheadDisplayStackInlineResponsive.tsx +19 -0
- package/src/components/Masthead/examples/MastheadIconRouterLink.tsx +31 -0
- package/src/components/Masthead/examples/MastheadInsets.tsx +19 -0
- package/src/components/Menu/MenuItem.tsx +5 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/Select/examples/Select.md +49 -9
- package/src/components/Text/examples/Text.md +1 -1
- package/src/components/Text/examples/TextVisited.tsx +3 -3
- package/src/components/Title/Title.tsx +2 -11
- package/src/components/Title/__tests__/Title.test.tsx +14 -14
- package/src/components/Title/__tests__/__snapshots__/Title.test.tsx.snap +1 -1
- package/src/components/Title/examples/TitleCustomSizes.tsx +6 -6
- package/src/components/Title/examples/TitleDefaultSizes.tsx +6 -6
- package/src/components/assets/PF-HorizontalLogo-Color.svg +29 -0
- package/src/demos/DashboardHeader.tsx +1 -1
- package/src/demos/DataList/examples/DataListExpandableControlInToolbar.tsx +397 -0
- package/src/demos/DataListDemo.md +1 -407
- package/src/demos/Masthead.md +1 -1
- package/src/demos/Nav.md +1 -1
- package/src/demos/NotificationDrawer/NotificationDrawer.md +1 -1
- package/src/demos/NotificationDrawer/examples/NotificationDrawerBasic.tsx +1 -1
- package/src/demos/NotificationDrawer/examples/NotificationDrawerGrouped.tsx +1 -1
- package/src/demos/Page.md +1 -1
- package/src/demos/RTL/RTL.md +1 -1
- package/src/demos/RTL/examples/PaginatedTable.jsx +1 -1
- package/src/demos/Wizard/WizardDemo.md +1 -1
- package/src/demos/assets/PF-HorizontalLogo-Color.svg +29 -0
- package/src/demos/examples/AlertGroup/AlertGroupToastWithNotificationDrawer.tsx +3 -3
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +1 -1
- package/src/demos/examples/Nav/NavFlyout.tsx +1 -1
- package/src/demos/examples/Nav/NavHorizontal.tsx +1 -1
- package/src/demos/examples/Nav/NavHorizontalWithSubnav.tsx +1 -1
- package/src/demos/examples/Nav/NavManual.tsx +1 -1
- package/src/demos/examples/Page/PageStickySectionBreadcrumb.tsx +1 -1
- package/src/demos/examples/Page/PageStickySectionGroup.tsx +1 -1
- package/src/demos/examples/Page/PageStickySectionGroupAlternate.tsx +1 -1
- package/src/demos/examples/Wizard/InPageWithDrawer.tsx +1 -1
- package/src/demos/examples/Wizard/InPageWithDrawerInformationalStep.tsx +1 -1
|
@@ -7,7 +7,7 @@ propComponents: ['Masthead', 'MastheadToggle', 'MastheadMain', 'MastheadBrand',
|
|
|
7
7
|
|
|
8
8
|
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
9
9
|
import { Link } from '@reach/router';
|
|
10
|
-
import pfIcon from '../../assets/
|
|
10
|
+
import pfIcon from '../../assets/PF-HorizontalLogo-Color.svg';
|
|
11
11
|
|
|
12
12
|
`Masthead` should contain the following components to maintain proper layout and formatting: `MastheadToggle`, `MastheadMain`, and `MastheadContent`.
|
|
13
13
|
|
|
@@ -17,173 +17,35 @@ import pfIcon from '../../assets/pf-logo.svg';
|
|
|
17
17
|
|
|
18
18
|
### Basic
|
|
19
19
|
|
|
20
|
-
```ts
|
|
21
|
-
import React from 'react';
|
|
22
|
-
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
23
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
24
|
-
|
|
25
|
-
<Masthead id="basic-example">
|
|
26
|
-
<MastheadToggle>
|
|
27
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
28
|
-
<BarsIcon />
|
|
29
|
-
</Button>
|
|
30
|
-
</MastheadToggle>
|
|
31
|
-
<MastheadMain>
|
|
32
|
-
<MastheadBrand>Logo</MastheadBrand>
|
|
33
|
-
</MastheadMain>
|
|
34
|
-
<MastheadContent>
|
|
35
|
-
<span>Content</span>
|
|
36
|
-
</MastheadContent>
|
|
37
|
-
</Masthead>;
|
|
20
|
+
```ts file="./MastheadBasic.tsx"
|
|
38
21
|
```
|
|
39
22
|
|
|
40
23
|
### Basic with mixed content
|
|
41
24
|
|
|
42
|
-
```ts
|
|
43
|
-
import React from 'react';
|
|
44
|
-
import {
|
|
45
|
-
Masthead,
|
|
46
|
-
MastheadToggle,
|
|
47
|
-
MastheadMain,
|
|
48
|
-
MastheadBrand,
|
|
49
|
-
MastheadContent,
|
|
50
|
-
Button,
|
|
51
|
-
Flex,
|
|
52
|
-
FlexItem
|
|
53
|
-
} from '@patternfly/react-core';
|
|
54
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
55
|
-
|
|
56
|
-
<Masthead id="basic-mixed">
|
|
57
|
-
<MastheadToggle>
|
|
58
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
59
|
-
<BarsIcon />
|
|
60
|
-
</Button>
|
|
61
|
-
</MastheadToggle>
|
|
62
|
-
<MastheadMain>
|
|
63
|
-
<MastheadBrand>Logo</MastheadBrand>
|
|
64
|
-
</MastheadMain>
|
|
65
|
-
<MastheadContent>
|
|
66
|
-
<Flex>
|
|
67
|
-
<span>Testing text color</span>
|
|
68
|
-
<Button>testing</Button>
|
|
69
|
-
<FlexItem alignSelf={{ default: 'alignSelfFlexEnd' }}>
|
|
70
|
-
<Button>testing</Button>
|
|
71
|
-
</FlexItem>
|
|
72
|
-
</Flex>
|
|
73
|
-
</MastheadContent>
|
|
74
|
-
</Masthead>;
|
|
25
|
+
```ts file="./MastheadBasicMixedContent.tsx"
|
|
75
26
|
```
|
|
76
27
|
|
|
77
28
|
### Display inline
|
|
78
29
|
|
|
79
|
-
```ts
|
|
80
|
-
import React from 'react';
|
|
81
|
-
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
82
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
83
|
-
|
|
84
|
-
<Masthead id="inline-masthead" display={{ default: 'inline' }}>
|
|
85
|
-
<MastheadToggle>
|
|
86
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
87
|
-
<BarsIcon />
|
|
88
|
-
</Button>
|
|
89
|
-
</MastheadToggle>
|
|
90
|
-
<MastheadMain>
|
|
91
|
-
<MastheadBrand>Logo</MastheadBrand>
|
|
92
|
-
</MastheadMain>
|
|
93
|
-
<MastheadContent>
|
|
94
|
-
<span>Content</span>
|
|
95
|
-
</MastheadContent>
|
|
96
|
-
</Masthead>;
|
|
30
|
+
```ts file="./MastheadDisplayInline.tsx"
|
|
97
31
|
```
|
|
98
32
|
|
|
99
33
|
### Display stack
|
|
100
34
|
|
|
101
|
-
```ts
|
|
102
|
-
import React from 'react';
|
|
103
|
-
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
104
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
105
|
-
|
|
106
|
-
<Masthead id="stack-masthead" display={{ default: 'stack' }}>
|
|
107
|
-
<MastheadToggle>
|
|
108
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
109
|
-
<BarsIcon />
|
|
110
|
-
</Button>
|
|
111
|
-
</MastheadToggle>
|
|
112
|
-
<MastheadMain>
|
|
113
|
-
<MastheadBrand>Logo</MastheadBrand>
|
|
114
|
-
</MastheadMain>
|
|
115
|
-
<MastheadContent>
|
|
116
|
-
<span>Content</span>
|
|
117
|
-
</MastheadContent>
|
|
118
|
-
</Masthead>;
|
|
35
|
+
```ts file="./MastheadDisplayStack.tsx"
|
|
119
36
|
```
|
|
120
37
|
|
|
121
38
|
### Display stack, display inline responsive
|
|
122
39
|
|
|
123
|
-
```ts
|
|
124
|
-
import React from 'react';
|
|
125
|
-
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
126
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
127
|
-
|
|
128
|
-
<Masthead id="stack-inline-masthead" display={{ default: 'inline', lg: 'stack', '2xl': 'inline' }}>
|
|
129
|
-
<MastheadToggle>
|
|
130
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
131
|
-
<BarsIcon />
|
|
132
|
-
</Button>
|
|
133
|
-
</MastheadToggle>
|
|
134
|
-
<MastheadMain>
|
|
135
|
-
<MastheadBrand>Logo</MastheadBrand>
|
|
136
|
-
</MastheadMain>
|
|
137
|
-
<MastheadContent>
|
|
138
|
-
<span>Content</span>
|
|
139
|
-
</MastheadContent>
|
|
140
|
-
</Masthead>;
|
|
40
|
+
```ts file="./MastheadDisplayStackInlineResponsive.tsx"
|
|
141
41
|
```
|
|
142
42
|
|
|
143
43
|
### Inset
|
|
144
44
|
|
|
145
|
-
```ts
|
|
146
|
-
import React from 'react';
|
|
147
|
-
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
148
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
149
|
-
|
|
150
|
-
<Masthead id="inset-masthead" inset={{ default: 'insetSm' }}>
|
|
151
|
-
<MastheadToggle>
|
|
152
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
153
|
-
<BarsIcon />
|
|
154
|
-
</Button>
|
|
155
|
-
</MastheadToggle>
|
|
156
|
-
<MastheadMain>
|
|
157
|
-
<MastheadBrand>Logo</MastheadBrand>
|
|
158
|
-
</MastheadMain>
|
|
159
|
-
<MastheadContent>
|
|
160
|
-
<span>Content</span>
|
|
161
|
-
</MastheadContent>
|
|
162
|
-
</Masthead>;
|
|
45
|
+
```ts file="./MastheadInsets.tsx"
|
|
163
46
|
```
|
|
164
47
|
|
|
165
48
|
### With icon router link
|
|
166
49
|
|
|
167
|
-
```ts
|
|
168
|
-
import React from 'react';
|
|
169
|
-
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button, Brand } from '@patternfly/react-core';
|
|
170
|
-
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
171
|
-
import { Link } from '@reach/router';
|
|
172
|
-
import pfIcon from '../../assets/pf-logo.svg';
|
|
173
|
-
|
|
174
|
-
<Masthead id="icon-router-link">
|
|
175
|
-
<MastheadToggle>
|
|
176
|
-
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
177
|
-
<BarsIcon />
|
|
178
|
-
</Button>
|
|
179
|
-
</MastheadToggle>
|
|
180
|
-
<MastheadMain>
|
|
181
|
-
<MastheadBrand component={props => <Link {...props} to="#" />}>
|
|
182
|
-
<Brand src={pfIcon} alt="PatternFly" heights={{ default: '36px' }} />
|
|
183
|
-
</MastheadBrand>
|
|
184
|
-
</MastheadMain>
|
|
185
|
-
<MastheadContent>
|
|
186
|
-
<span>Content</span>
|
|
187
|
-
</MastheadContent>
|
|
188
|
-
</Masthead>;
|
|
50
|
+
```ts file="./MastheadIconRouterLink.tsx"
|
|
189
51
|
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
3
|
+
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
4
|
+
|
|
5
|
+
export const MastheadBasic: React.FunctionComponent = () => (
|
|
6
|
+
<Masthead id="basic-example">
|
|
7
|
+
<MastheadToggle>
|
|
8
|
+
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
9
|
+
<BarsIcon />
|
|
10
|
+
</Button>
|
|
11
|
+
</MastheadToggle>
|
|
12
|
+
<MastheadMain>
|
|
13
|
+
<MastheadBrand component="a">Logo</MastheadBrand>
|
|
14
|
+
</MastheadMain>
|
|
15
|
+
<MastheadContent>
|
|
16
|
+
<span>Content</span>
|
|
17
|
+
</MastheadContent>
|
|
18
|
+
</Masthead>
|
|
19
|
+
);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Masthead,
|
|
4
|
+
MastheadToggle,
|
|
5
|
+
MastheadMain,
|
|
6
|
+
MastheadBrand,
|
|
7
|
+
MastheadContent,
|
|
8
|
+
Button,
|
|
9
|
+
Flex,
|
|
10
|
+
FlexItem
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
13
|
+
|
|
14
|
+
export const MastheadBasicMixedContent: React.FunctionComponent = () => (
|
|
15
|
+
<Masthead id="basic-mixed">
|
|
16
|
+
<MastheadToggle>
|
|
17
|
+
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
18
|
+
<BarsIcon />
|
|
19
|
+
</Button>
|
|
20
|
+
</MastheadToggle>
|
|
21
|
+
<MastheadMain>
|
|
22
|
+
<MastheadBrand component="a">Logo</MastheadBrand>
|
|
23
|
+
</MastheadMain>
|
|
24
|
+
<MastheadContent>
|
|
25
|
+
<Flex>
|
|
26
|
+
<span>Content</span>
|
|
27
|
+
<Button>Primary</Button>
|
|
28
|
+
<FlexItem alignSelf={{ default: 'alignSelfFlexEnd' }}>
|
|
29
|
+
<Button variant="secondary">Secondary</Button>
|
|
30
|
+
</FlexItem>
|
|
31
|
+
<FlexItem alignSelf={{ default: 'alignSelfFlexEnd' }}>
|
|
32
|
+
<Button variant="tertiary">Tertiary</Button>
|
|
33
|
+
</FlexItem>
|
|
34
|
+
</Flex>
|
|
35
|
+
</MastheadContent>
|
|
36
|
+
</Masthead>
|
|
37
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
3
|
+
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
4
|
+
|
|
5
|
+
export const MastheadDisplayInline: React.FunctionComponent = () => (
|
|
6
|
+
<Masthead id="inline-masthead" display={{ default: 'inline' }}>
|
|
7
|
+
<MastheadToggle>
|
|
8
|
+
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
9
|
+
<BarsIcon />
|
|
10
|
+
</Button>
|
|
11
|
+
</MastheadToggle>
|
|
12
|
+
<MastheadMain>
|
|
13
|
+
<MastheadBrand component="a">Logo</MastheadBrand>
|
|
14
|
+
</MastheadMain>
|
|
15
|
+
<MastheadContent>
|
|
16
|
+
<span>Content</span>
|
|
17
|
+
</MastheadContent>
|
|
18
|
+
</Masthead>
|
|
19
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
3
|
+
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
4
|
+
|
|
5
|
+
export const MastheadDisplayStack: React.FunctionComponent = () => (
|
|
6
|
+
<Masthead id="stack-masthead" display={{ default: 'stack' }}>
|
|
7
|
+
<MastheadToggle>
|
|
8
|
+
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
9
|
+
<BarsIcon />
|
|
10
|
+
</Button>
|
|
11
|
+
</MastheadToggle>
|
|
12
|
+
<MastheadMain>
|
|
13
|
+
<MastheadBrand component="a">Logo</MastheadBrand>
|
|
14
|
+
</MastheadMain>
|
|
15
|
+
<MastheadContent>
|
|
16
|
+
<span>Content</span>
|
|
17
|
+
</MastheadContent>
|
|
18
|
+
</Masthead>
|
|
19
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
3
|
+
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
4
|
+
|
|
5
|
+
export const MastheadDisplayStackInlineResponsive: React.FunctionComponent = () => (
|
|
6
|
+
<Masthead id="stack-inline-masthead" display={{ default: 'inline', lg: 'stack', '2xl': 'inline' }}>
|
|
7
|
+
<MastheadToggle>
|
|
8
|
+
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
9
|
+
<BarsIcon />
|
|
10
|
+
</Button>
|
|
11
|
+
</MastheadToggle>
|
|
12
|
+
<MastheadMain>
|
|
13
|
+
<MastheadBrand component="a">Logo</MastheadBrand>
|
|
14
|
+
</MastheadMain>
|
|
15
|
+
<MastheadContent>
|
|
16
|
+
<span>Content</span>
|
|
17
|
+
</MastheadContent>
|
|
18
|
+
</Masthead>
|
|
19
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Masthead,
|
|
4
|
+
MastheadToggle,
|
|
5
|
+
MastheadMain,
|
|
6
|
+
MastheadBrand,
|
|
7
|
+
MastheadContent,
|
|
8
|
+
Button,
|
|
9
|
+
Brand
|
|
10
|
+
} from '@patternfly/react-core';
|
|
11
|
+
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
12
|
+
import { Link } from '@reach/router';
|
|
13
|
+
import pfIcon from '../../assets/PF-HorizontalLogo-Color.svg';
|
|
14
|
+
|
|
15
|
+
export const MastheadIconRouterLink: React.FunctionComponent = () => (
|
|
16
|
+
<Masthead id="icon-router-link">
|
|
17
|
+
<MastheadToggle>
|
|
18
|
+
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
19
|
+
<BarsIcon />
|
|
20
|
+
</Button>
|
|
21
|
+
</MastheadToggle>
|
|
22
|
+
<MastheadMain>
|
|
23
|
+
<MastheadBrand component={(props) => <Link {...props} to="#" />}>
|
|
24
|
+
<Brand src={pfIcon} alt="PatternFly" heights={{ default: '36px' }} />
|
|
25
|
+
</MastheadBrand>
|
|
26
|
+
</MastheadMain>
|
|
27
|
+
<MastheadContent>
|
|
28
|
+
<span>Content</span>
|
|
29
|
+
</MastheadContent>
|
|
30
|
+
</Masthead>
|
|
31
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Masthead, MastheadToggle, MastheadMain, MastheadBrand, MastheadContent, Button } from '@patternfly/react-core';
|
|
3
|
+
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
4
|
+
|
|
5
|
+
export const MastheadInsets: React.FunctionComponent = () => (
|
|
6
|
+
<Masthead id="inset-masthead" inset={{ default: 'insetSm' }}>
|
|
7
|
+
<MastheadToggle>
|
|
8
|
+
<Button variant="plain" onClick={() => {}} aria-label="Global navigation">
|
|
9
|
+
<BarsIcon />
|
|
10
|
+
</Button>
|
|
11
|
+
</MastheadToggle>
|
|
12
|
+
<MastheadMain>
|
|
13
|
+
<MastheadBrand component="a">Logo</MastheadBrand>
|
|
14
|
+
</MastheadMain>
|
|
15
|
+
<MastheadContent>
|
|
16
|
+
<span>Content</span>
|
|
17
|
+
</MastheadContent>
|
|
18
|
+
</Masthead>
|
|
19
|
+
);
|
|
@@ -29,6 +29,8 @@ export interface MenuItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'onC
|
|
|
29
29
|
target?: string;
|
|
30
30
|
/** Navigation link relationship. Only set when the to property is present. */
|
|
31
31
|
rel?: string;
|
|
32
|
+
/** Navigation link download. Only set when the to property is present. */
|
|
33
|
+
download?: string;
|
|
32
34
|
/** Flag indicating the item has a checkbox */
|
|
33
35
|
hasCheckbox?: boolean;
|
|
34
36
|
/** Flag indicating whether the item is active */
|
|
@@ -119,6 +121,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
|
|
|
119
121
|
tooltipProps,
|
|
120
122
|
rel,
|
|
121
123
|
target,
|
|
124
|
+
download,
|
|
122
125
|
...props
|
|
123
126
|
}: MenuItemProps) => {
|
|
124
127
|
const {
|
|
@@ -271,7 +274,8 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
|
|
|
271
274
|
// prevent invalid 'disabled' attribute on <a> tags
|
|
272
275
|
disabled: null,
|
|
273
276
|
target: isExternalLink ? '_blank' : target,
|
|
274
|
-
rel
|
|
277
|
+
rel,
|
|
278
|
+
download
|
|
275
279
|
};
|
|
276
280
|
} else if (Component === 'button') {
|
|
277
281
|
additionalProps = {
|
|
@@ -415,7 +415,7 @@ export const Popover: React.FunctionComponent<PopoverProps> = ({
|
|
|
415
415
|
ref={popoverRef}
|
|
416
416
|
active={focusTrapActive}
|
|
417
417
|
focusTrapOptions={{
|
|
418
|
-
returnFocusOnDeactivate:
|
|
418
|
+
returnFocusOnDeactivate: propWithFocusTrap !== false,
|
|
419
419
|
clickOutsideDeactivates: true,
|
|
420
420
|
// FocusTrap's initialFocus can accept false as a value to prevent initial focus.
|
|
421
421
|
// We want to prevent this in case false is ever passed in.
|
|
@@ -13,72 +13,112 @@ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
|
13
13
|
|
|
14
14
|
## Examples
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Select builds off of the menu component suite to adapt commonly used properties and functions to create a select menu. See the [menu documentation](/components/menus/menu) for a full list of properties that may be used to further customize a select menu. View the [custom menu examples](/components/menus/custom-menus) to see examples of fully functional select menus.
|
|
17
17
|
|
|
18
|
-
### Single
|
|
18
|
+
### Single select
|
|
19
|
+
To let users select a single item from a list, use a single select menu.
|
|
20
|
+
|
|
21
|
+
You can add multiple `<SelectOption>` components to build out a list of menu items. For each select option, pass a relevant option label to the `value` property.
|
|
22
|
+
|
|
23
|
+
To disable the select menu toggle, use the `isDisabled` property. In the following example, select the checkbox to observe this behavior.
|
|
19
24
|
|
|
20
25
|
```ts file="./SelectBasic.tsx"
|
|
21
26
|
|
|
22
27
|
```
|
|
23
28
|
|
|
24
|
-
###
|
|
29
|
+
### Select option variants
|
|
30
|
+
|
|
31
|
+
The following example showcases different option variants and customizations that are commonly used in a select menu.
|
|
32
|
+
|
|
33
|
+
To create these variants, you can pass different properties into a `<SelectOption>` component.
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
This example provides examples of:
|
|
36
|
+
|
|
37
|
+
- An option with a description, which is created by using the `description` property.
|
|
38
|
+
- An option with a link, which is created by passing a URL into the `to` property. For external links, use the `isExternalLink` property so that the option is styled with an outbound link icon.
|
|
39
|
+
- An option with an icon, which is created by using the `icon` property.
|
|
40
|
+
- An option that is disabled by using the `isDisabled` property.
|
|
27
41
|
|
|
28
42
|
```ts file="./SelectOptionVariations.tsx"
|
|
29
43
|
|
|
30
44
|
```
|
|
31
45
|
|
|
32
|
-
###
|
|
46
|
+
### With grouped items
|
|
47
|
+
To group related select options together, use 1 or more `<SelectGroup>` components and title each group using the `label` property.
|
|
33
48
|
|
|
34
49
|
```ts file="./SelectGrouped.tsx"
|
|
35
50
|
|
|
36
51
|
```
|
|
37
52
|
|
|
38
|
-
### Checkbox
|
|
53
|
+
### Checkbox select
|
|
54
|
+
To let users select multiple list options via checkbox input, use a checkbox select.
|
|
55
|
+
|
|
56
|
+
To create a checkbox select, pass `role="menu"` to the `<Select>`, and `hasCheckbox` into each `<SelectOption>` component. To indicate that an option is selected, use the `isSelected` property.
|
|
57
|
+
|
|
58
|
+
By default, the menu toggle will display a badge to indicate the number of items that a user has selected.
|
|
39
59
|
|
|
40
60
|
```ts file="./SelectCheckbox.tsx"
|
|
41
61
|
|
|
42
62
|
```
|
|
43
63
|
|
|
44
64
|
### Typeahead
|
|
65
|
+
Typeahead is a select variant that replaces the typical button toggle for opening the select menu with a text input and button toggle combo. As a user enters characters into the text input, the menu options will be filtered to match.
|
|
66
|
+
|
|
67
|
+
To make a typeahead, pass `variant=typeahead` into the `<MenuToggle>` component and link an `onClick` function to the `<TextInputGroupMain>` component.
|
|
45
68
|
|
|
46
69
|
```ts file="./SelectTypeahead.tsx"
|
|
47
70
|
|
|
48
71
|
```
|
|
49
72
|
|
|
50
73
|
### Typeahead with create option
|
|
74
|
+
If a user enters a value into a typeahead select menu that does not exist, you can allow them to create an option of that value.
|
|
75
|
+
|
|
76
|
+
To enable the creation ability, pass a predetermined `value` into a `<SelectOption>` component. You can use the `placeholder` property to change the default text shown in the text input.
|
|
77
|
+
|
|
78
|
+
The following example outlines the code implementation required to create a working typeahead menu that allows for creation.
|
|
51
79
|
|
|
52
80
|
```ts file="./SelectTypeaheadCreatable.tsx"
|
|
53
81
|
|
|
54
82
|
```
|
|
55
83
|
|
|
56
84
|
### Multiple typeahead with chips
|
|
85
|
+
A multiple typeahead can be used to allow users to select multiple options from a list. Additionally, you can render a chip group to be placed in the select toggle.
|
|
86
|
+
|
|
87
|
+
When more items than the allowed limit are selected, overflowing items will be hidden under a "more" button. The following example hides items after more than 3 are selected. To show hidden items, select the “more” button. Select "show less" to hide extra items again.
|
|
57
88
|
|
|
58
89
|
```ts file="./SelectMultiTypeahead.tsx"
|
|
59
90
|
|
|
60
91
|
```
|
|
61
92
|
|
|
62
93
|
### Multiple typeahead with create option
|
|
94
|
+
If the text that is entered into a typeahead doesn't match a menu item, users can choose to create a new option that matches the text input. You can also combine this create functionality with a chip group to display created items as chips."
|
|
63
95
|
|
|
64
96
|
```ts file="./SelectMultiTypeaheadCreatable.tsx"
|
|
65
97
|
|
|
66
98
|
```
|
|
67
99
|
|
|
68
100
|
### Multiple typeahead with checkboxes
|
|
101
|
+
By default, a multiple typeahead select allows you to select multiple menu items, placing a checkmark beside selected items. Like basic checkbox select menus, you can add checkboxes to your menu items. This approach may be more accurate and comprehensive for more complex menu scenarios like filtering.
|
|
69
102
|
|
|
70
103
|
```ts file="./SelectMultiTypeaheadCheckbox.tsx"
|
|
71
104
|
|
|
72
105
|
```
|
|
73
106
|
|
|
74
|
-
###
|
|
107
|
+
### With view more
|
|
108
|
+
|
|
109
|
+
To reduce the processing load for long select lists, you can add a "View more" action to load additional items.
|
|
110
|
+
|
|
111
|
+
The following example shows 3 items before the "View more" link, but you can adjust the number of visible items for your use case.
|
|
75
112
|
|
|
76
113
|
```ts file="./SelectViewMore.tsx"
|
|
77
114
|
|
|
78
115
|
```
|
|
79
116
|
|
|
80
|
-
###
|
|
117
|
+
### With a footer
|
|
118
|
+
|
|
119
|
+
You can add a `<MenuFooter>` component to a select menu to hold additional actions that users can take on menu items, through elements such as link buttons. A footer will be placed beneath a divider at the end of the select menu.
|
|
120
|
+
|
|
81
121
|
|
|
82
122
|
```ts file="./SelectFooter.tsx"
|
|
83
123
|
|
|
84
|
-
```
|
|
124
|
+
```
|
|
@@ -4,16 +4,16 @@ import { TextContent, Text, TextVariants } from '@patternfly/react-core';
|
|
|
4
4
|
export const TextVisited: React.FunctionComponent = () => (
|
|
5
5
|
<>
|
|
6
6
|
<TextContent>
|
|
7
|
-
<Text component={TextVariants.h3}>
|
|
7
|
+
<Text component={TextVariants.h3}>Link example</Text>
|
|
8
8
|
<Text component={TextVariants.p}>
|
|
9
9
|
<Text component={TextVariants.a} isVisitedLink href="#">
|
|
10
|
-
|
|
10
|
+
Click to visit link
|
|
11
11
|
</Text>
|
|
12
12
|
</Text>
|
|
13
13
|
</TextContent>
|
|
14
14
|
<br />
|
|
15
15
|
<TextContent isVisited>
|
|
16
|
-
<Text component={TextVariants.h3}>
|
|
16
|
+
<Text component={TextVariants.h3}>Link content example</Text>
|
|
17
17
|
<Text component={TextVariants.p}>
|
|
18
18
|
<Text component={TextVariants.a} href="#">
|
|
19
19
|
content link 1
|
|
@@ -12,15 +12,6 @@ export enum TitleSizes {
|
|
|
12
12
|
'4xl' = '4xl'
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
enum headingLevelSizeMap {
|
|
16
|
-
h1 = '2xl',
|
|
17
|
-
h2 = 'xl',
|
|
18
|
-
h3 = 'lg',
|
|
19
|
-
h4 = 'md',
|
|
20
|
-
h5 = 'md',
|
|
21
|
-
h6 = 'md'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
15
|
type Size = 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
|
|
25
16
|
|
|
26
17
|
export interface TitleProps extends Omit<React.HTMLProps<HTMLHeadingElement>, 'size' | 'className'>, OUIAProps {
|
|
@@ -42,7 +33,7 @@ export const Title: React.FunctionComponent<TitleProps> = ({
|
|
|
42
33
|
className = '',
|
|
43
34
|
children = '',
|
|
44
35
|
headingLevel: HeadingLevel,
|
|
45
|
-
size
|
|
36
|
+
size,
|
|
46
37
|
ouiaId,
|
|
47
38
|
ouiaSafe = true,
|
|
48
39
|
...props
|
|
@@ -52,7 +43,7 @@ export const Title: React.FunctionComponent<TitleProps> = ({
|
|
|
52
43
|
<HeadingLevel
|
|
53
44
|
{...ouiaProps}
|
|
54
45
|
{...props}
|
|
55
|
-
className={css(styles.title, size
|
|
46
|
+
className={css(styles.title, size ? styles.modifiers[size as Size] : styles.modifiers[HeadingLevel], className)}
|
|
56
47
|
>
|
|
57
48
|
{children}
|
|
58
49
|
</HeadingLevel>
|
|
@@ -22,9 +22,9 @@ test(`Renders with the ${styles.title}`, () => {
|
|
|
22
22
|
expect(screen.getByRole('heading')).toHaveClass(styles.title);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
test(`Renders with only the class ${styles.title} and the heading level modifier class ${styles.modifiers
|
|
25
|
+
test(`Renders with only the class ${styles.title} and the heading level modifier class ${styles.modifiers.h1} by default`, () => {
|
|
26
26
|
render(<Title headingLevel="h1">Test</Title>);
|
|
27
|
-
expect(screen.getByRole('heading')).toHaveClass(`${styles.title} ${styles.modifiers
|
|
27
|
+
expect(screen.getByRole('heading')).toHaveClass(`${styles.title} ${styles.modifiers.h1}`, { exact: true });
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
test('Renders with custom class name when className prop is passed', () => {
|
|
@@ -36,34 +36,34 @@ test('Renders with custom class name when className prop is passed', () => {
|
|
|
36
36
|
expect(screen.getByRole('heading')).toHaveClass('test-class');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
test('Renders with class name pf-m-
|
|
39
|
+
test('Renders with class name pf-m-h1 by default when "h1" is passed as heading level', () => {
|
|
40
40
|
render(<Title headingLevel="h1">Test</Title>);
|
|
41
|
-
expect(screen.getByRole('heading')).toHaveClass('pf-m-
|
|
41
|
+
expect(screen.getByRole('heading')).toHaveClass('pf-m-h1');
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
test('Renders with class name pf-m-
|
|
44
|
+
test('Renders with class name pf-m-h2 by default when "h2" is passed as heading level', () => {
|
|
45
45
|
render(<Title headingLevel="h2">Test</Title>);
|
|
46
|
-
expect(screen.getByRole('heading')).toHaveClass('pf-m-
|
|
46
|
+
expect(screen.getByRole('heading')).toHaveClass('pf-m-h2');
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
test('Renders with class name pf-m-
|
|
49
|
+
test('Renders with class name pf-m-h3 by default when "h3" is passed as heading level', () => {
|
|
50
50
|
render(<Title headingLevel="h3">Test</Title>);
|
|
51
|
-
expect(screen.getByRole('heading')).toHaveClass('pf-m-
|
|
51
|
+
expect(screen.getByRole('heading')).toHaveClass('pf-m-h3');
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
test('Renders with class name pf-m-
|
|
54
|
+
test('Renders with class name pf-m-h4 by default when "h4" is passed as heading level', () => {
|
|
55
55
|
render(<Title headingLevel="h4">Test</Title>);
|
|
56
|
-
expect(screen.getByRole('heading')).toHaveClass('pf-m-
|
|
56
|
+
expect(screen.getByRole('heading')).toHaveClass('pf-m-h4');
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
test('Renders with class name pf-m-
|
|
59
|
+
test('Renders with class name pf-m-h5 by default when "h5" is passed as heading level', () => {
|
|
60
60
|
render(<Title headingLevel="h5">Test</Title>);
|
|
61
|
-
expect(screen.getByRole('heading')).toHaveClass('pf-m-
|
|
61
|
+
expect(screen.getByRole('heading')).toHaveClass('pf-m-h5');
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
test('Renders with class name pf-m-
|
|
64
|
+
test('Renders with class name pf-m-h6 by default when "h6" is passed as heading level', () => {
|
|
65
65
|
render(<Title headingLevel="h6">Test</Title>);
|
|
66
|
-
expect(screen.getByRole('heading')).toHaveClass('pf-m-
|
|
66
|
+
expect(screen.getByRole('heading')).toHaveClass('pf-m-h6');
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
test('Renders with class name pf-m-md when "md" is passed as title size', () => {
|