@patternfly/react-core 4.224.5 → 4.224.8
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 +24 -0
- package/dist/esm/components/NotificationDrawer/NotificationDrawerGroup.d.ts +2 -0
- package/dist/esm/components/NotificationDrawer/NotificationDrawerGroup.d.ts.map +1 -1
- package/dist/esm/components/NotificationDrawer/NotificationDrawerGroup.js +2 -2
- package/dist/esm/components/NotificationDrawer/NotificationDrawerGroup.js.map +1 -1
- package/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts +2 -0
- package/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts.map +1 -1
- package/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.js +2 -2
- package/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.js.map +1 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawerGroup.d.ts +2 -0
- package/dist/js/components/NotificationDrawer/NotificationDrawerGroup.d.ts.map +1 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawerGroup.js +2 -2
- package/dist/js/components/NotificationDrawer/NotificationDrawerGroup.js.map +1 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts +2 -0
- package/dist/js/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts.map +1 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawerListItemHeader.js +2 -2
- package/dist/js/components/NotificationDrawer/NotificationDrawerListItemHeader.js.map +1 -1
- package/dist/umd/react-core.css +34 -34
- package/dist/umd/react-core.js +4 -4
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/NotificationDrawer/NotificationDrawerGroup.tsx +5 -2
- package/src/components/NotificationDrawer/NotificationDrawerListItemHeader.tsx +5 -2
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerGroup.test.tsx +5 -0
- package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItemHeader.test.tsx +5 -0
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerGroup.test.tsx.snap +47 -0
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawerListItemHeader.test.tsx.snap +31 -0
- package/src/components/Tabs/examples/Tabs.md +131 -111
- package/src/components/Tabs/examples/TabsDynamic.tsx +1 -0
- package/src/components/Toolbar/examples/Toolbar.md +2 -2
- package/src/components/Toolbar/examples/ToolbarCustomChipGroupContent.tsx +1 -1
- package/src/components/Wizard/examples/Wizard.md +11 -11
- package/src/demos/CardDemos.md +27 -26
- package/src/demos/Masthead.md +1 -1
- package/src/demos/TileDemo.md +8 -8
- package/src/layouts/Grid/examples/Grid.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.224.
|
|
3
|
+
"version": "4.224.8",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.75.
|
|
38
|
-
"@patternfly/react-styles": "^4.74.
|
|
39
|
-
"@patternfly/react-tokens": "^4.76.
|
|
37
|
+
"@patternfly/react-icons": "^4.75.8",
|
|
38
|
+
"@patternfly/react-styles": "^4.74.8",
|
|
39
|
+
"@patternfly/react-tokens": "^4.76.8",
|
|
40
40
|
"focus-trap": "6.9.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "ca94c1683c2b516b9314f6e224065a3e77a31cff"
|
|
64
64
|
}
|
|
@@ -41,6 +41,8 @@ export interface NotificationDrawerGroupProps extends Omit<React.HTMLProps<HTMLD
|
|
|
41
41
|
| 'left-end'
|
|
42
42
|
| 'right-start'
|
|
43
43
|
| 'right-end';
|
|
44
|
+
/** Sets the heading level to use for the group title. Default is h1. */
|
|
45
|
+
headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export const NotificationDrawerGroup: React.FunctionComponent<NotificationDrawerGroupProps> = ({
|
|
@@ -54,6 +56,7 @@ export const NotificationDrawerGroup: React.FunctionComponent<NotificationDrawer
|
|
|
54
56
|
title,
|
|
55
57
|
truncateTitle = 0,
|
|
56
58
|
tooltipPosition,
|
|
59
|
+
headingLevel: HeadingLevel = 'h1',
|
|
57
60
|
...props
|
|
58
61
|
}: NotificationDrawerGroupProps) => {
|
|
59
62
|
const titleRef = React.useRef(null);
|
|
@@ -85,7 +88,7 @@ export const NotificationDrawerGroup: React.FunctionComponent<NotificationDrawer
|
|
|
85
88
|
{...props}
|
|
86
89
|
className={css(styles.notificationDrawerGroup, isExpanded && styles.modifiers.expanded, className)}
|
|
87
90
|
>
|
|
88
|
-
<
|
|
91
|
+
<HeadingLevel>
|
|
89
92
|
<button
|
|
90
93
|
className={css(styles.notificationDrawerGroupToggle)}
|
|
91
94
|
aria-expanded={isExpanded}
|
|
@@ -112,7 +115,7 @@ export const NotificationDrawerGroup: React.FunctionComponent<NotificationDrawer
|
|
|
112
115
|
<AngleRightIcon />
|
|
113
116
|
</span>
|
|
114
117
|
</button>
|
|
115
|
-
</
|
|
118
|
+
</HeadingLevel>
|
|
116
119
|
{children}
|
|
117
120
|
</section>
|
|
118
121
|
);
|
|
@@ -52,6 +52,8 @@ export interface NotificationDrawerListItemHeaderProps extends React.HTMLProps<H
|
|
|
52
52
|
| 'left-end'
|
|
53
53
|
| 'right-start'
|
|
54
54
|
| 'right-end';
|
|
55
|
+
/** Sets the heading level to use for the list item header title. Default is h2. */
|
|
56
|
+
headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
export const NotificationDrawerListItemHeader: React.FunctionComponent<NotificationDrawerListItemHeaderProps> = ({
|
|
@@ -63,6 +65,7 @@ export const NotificationDrawerListItemHeader: React.FunctionComponent<Notificat
|
|
|
63
65
|
variant = 'default',
|
|
64
66
|
truncateTitle = 0,
|
|
65
67
|
tooltipPosition,
|
|
68
|
+
headingLevel: HeadingLevel = 'h2',
|
|
66
69
|
...props
|
|
67
70
|
}: NotificationDrawerListItemHeaderProps) => {
|
|
68
71
|
const titleRef = React.useRef(null);
|
|
@@ -79,14 +82,14 @@ export const NotificationDrawerListItemHeader: React.FunctionComponent<Notificat
|
|
|
79
82
|
}, [titleRef, truncateTitle, isTooltipVisible]);
|
|
80
83
|
const Icon = variantIcons[variant];
|
|
81
84
|
const Title = (
|
|
82
|
-
<
|
|
85
|
+
<HeadingLevel
|
|
83
86
|
{...(isTooltipVisible && { tabIndex: 0 })}
|
|
84
87
|
ref={titleRef}
|
|
85
88
|
className={css(styles.notificationDrawerListItemHeaderTitle, truncateTitle && styles.modifiers.truncate)}
|
|
86
89
|
>
|
|
87
90
|
{srTitle && <span className={css(a11yStyles.screenReader)}>{srTitle}</span>}
|
|
88
91
|
{title}
|
|
89
|
-
</
|
|
92
|
+
</HeadingLevel>
|
|
90
93
|
);
|
|
91
94
|
|
|
92
95
|
return (
|
|
@@ -11,6 +11,11 @@ describe('NotificationDrawerGroup', () => {
|
|
|
11
11
|
expect(asFragment()).toMatchSnapshot();
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
+
test('renders correct heading level', () => {
|
|
15
|
+
const { asFragment } = render(<NotificationDrawerGroup count={2} isExpanded={false} title="Critical Alerts" headingLevel="h2" />);
|
|
16
|
+
expect(asFragment()).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
14
19
|
test('className is added to the root element', () => {
|
|
15
20
|
render(
|
|
16
21
|
<NotificationDrawerGroup
|
package/src/components/NotificationDrawer/__tests__/NotificationDrawerListItemHeader.test.tsx
CHANGED
|
@@ -12,6 +12,11 @@ describe('NotificationDrawerListItemHeader', () => {
|
|
|
12
12
|
expect(asFragment()).toMatchSnapshot();
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
+
test('renders with correct heading level', () => {
|
|
16
|
+
const { asFragment } = render(<NotificationDrawerListItemHeader title="Pod quit unexpectedly" headingLevel="h3"/>);
|
|
17
|
+
expect(asFragment()).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
|
|
15
20
|
test('className is added to the root element', () => {
|
|
16
21
|
render(
|
|
17
22
|
<NotificationDrawerListItemHeader title="Pod quit unexpectedly" className="extra-class" data-testid="test-id" />
|
|
@@ -94,6 +94,53 @@ exports[`NotificationDrawerGroup drawer group with isRead applied 1`] = `
|
|
|
94
94
|
</DocumentFragment>
|
|
95
95
|
`;
|
|
96
96
|
|
|
97
|
+
exports[`NotificationDrawerGroup renders correct heading level 1`] = `
|
|
98
|
+
<DocumentFragment>
|
|
99
|
+
<section
|
|
100
|
+
class="pf-c-notification-drawer__group"
|
|
101
|
+
>
|
|
102
|
+
<h2>
|
|
103
|
+
<button
|
|
104
|
+
aria-expanded="false"
|
|
105
|
+
class="pf-c-notification-drawer__group-toggle"
|
|
106
|
+
>
|
|
107
|
+
<div
|
|
108
|
+
class="pf-c-notification-drawer__group-toggle-title"
|
|
109
|
+
>
|
|
110
|
+
Critical Alerts
|
|
111
|
+
</div>
|
|
112
|
+
<div
|
|
113
|
+
class="pf-c-notification-drawer__group-toggle-count"
|
|
114
|
+
>
|
|
115
|
+
<span
|
|
116
|
+
class="pf-c-badge pf-m-unread"
|
|
117
|
+
>
|
|
118
|
+
2
|
|
119
|
+
</span>
|
|
120
|
+
</div>
|
|
121
|
+
<span
|
|
122
|
+
class="pf-c-notification-drawer__group-toggle-icon"
|
|
123
|
+
>
|
|
124
|
+
<svg
|
|
125
|
+
aria-hidden="true"
|
|
126
|
+
fill="currentColor"
|
|
127
|
+
height="1em"
|
|
128
|
+
role="img"
|
|
129
|
+
style="vertical-align: -0.125em;"
|
|
130
|
+
viewBox="0 0 256 512"
|
|
131
|
+
width="1em"
|
|
132
|
+
>
|
|
133
|
+
<path
|
|
134
|
+
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
|
|
135
|
+
/>
|
|
136
|
+
</svg>
|
|
137
|
+
</span>
|
|
138
|
+
</button>
|
|
139
|
+
</h2>
|
|
140
|
+
</section>
|
|
141
|
+
</DocumentFragment>
|
|
142
|
+
`;
|
|
143
|
+
|
|
97
144
|
exports[`NotificationDrawerGroup renders with PatternFly Core styles 1`] = `
|
|
98
145
|
<DocumentFragment>
|
|
99
146
|
<section
|
|
@@ -128,3 +128,34 @@ exports[`NotificationDrawerListItemHeader renders with PatternFly Core styles 1`
|
|
|
128
128
|
</div>
|
|
129
129
|
</DocumentFragment>
|
|
130
130
|
`;
|
|
131
|
+
|
|
132
|
+
exports[`NotificationDrawerListItemHeader renders with correct heading level 1`] = `
|
|
133
|
+
<DocumentFragment>
|
|
134
|
+
<div
|
|
135
|
+
class="pf-c-notification-drawer__list-item-header"
|
|
136
|
+
>
|
|
137
|
+
<span
|
|
138
|
+
class="pf-c-notification-drawer__list-item-header-icon"
|
|
139
|
+
>
|
|
140
|
+
<svg
|
|
141
|
+
aria-hidden="true"
|
|
142
|
+
fill="currentColor"
|
|
143
|
+
height="1em"
|
|
144
|
+
role="img"
|
|
145
|
+
style="vertical-align: -0.125em;"
|
|
146
|
+
viewBox="0 0 896 1024"
|
|
147
|
+
width="1em"
|
|
148
|
+
>
|
|
149
|
+
<path
|
|
150
|
+
d="M448,0 C465.333333,0 480.333333,6.33333333 493,19 C505.666667,31.6666667 512,46.6666667 512,64 L512,106 L514.23,106.45 C587.89,121.39 648.48,157.24 696,214 C744,271.333333 768,338.666667 768,416 C768,500 780,568.666667 804,622 C818.666667,652.666667 841.333333,684 872,716 C873.773676,718.829136 875.780658,721.505113 878,724 C890,737.333333 896,752.333333 896,769 C896,785.666667 890,800.333333 878,813 C866,825.666667 850.666667,832 832,832 L63.3,832 C44.9533333,831.84 29.8533333,825.506667 18,813 C6,800.333333 0,785.666667 0,769 C0,752.333333 6,737.333333 18,724 L24,716 L25.06,714.9 C55.1933333,683.28 77.5066667,652.313333 92,622 C116,568.666667 128,500 128,416 C128,338.666667 152,271.333333 200,214 C248,156.666667 309.333333,120.666667 384,106 L384,63.31 C384.166667,46.27 390.5,31.5 403,19 C415.666667,6.33333333 430.666667,0 448,0 Z M576,896 L576,897.08 C575.74,932.6 563.073333,962.573333 538,987 C512.666667,1011.66667 482.666667,1024 448,1024 C413.333333,1024 383.333333,1011.66667 358,987 C332.666667,962.333333 320,932 320,896 L576,896 Z"
|
|
151
|
+
/>
|
|
152
|
+
</svg>
|
|
153
|
+
</span>
|
|
154
|
+
<h3
|
|
155
|
+
class="pf-c-notification-drawer__list-item-header-title"
|
|
156
|
+
>
|
|
157
|
+
Pod quit unexpectedly
|
|
158
|
+
</h3>
|
|
159
|
+
</div>
|
|
160
|
+
</DocumentFragment>
|
|
161
|
+
`;
|