@patternfly/react-core 4.241.0 → 4.241.1
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 +11 -0
- package/dist/esm/components/OverflowMenu/OverflowMenu.d.ts +1 -0
- package/dist/esm/components/OverflowMenu/OverflowMenu.d.ts.map +1 -1
- package/dist/esm/components/OverflowMenu/OverflowMenu.js +3 -2
- package/dist/esm/components/OverflowMenu/OverflowMenu.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +2 -2
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/helpers/Popper/FindRefWrapper.d.ts +1 -1
- package/dist/js/components/OverflowMenu/OverflowMenu.d.ts +1 -0
- package/dist/js/components/OverflowMenu/OverflowMenu.d.ts.map +1 -1
- package/dist/js/components/OverflowMenu/OverflowMenu.js +3 -2
- package/dist/js/components/OverflowMenu/OverflowMenu.js.map +1 -1
- package/dist/js/components/Tabs/Tabs.js +2 -2
- package/dist/js/components/Tabs/Tabs.js.map +1 -1
- package/dist/js/helpers/Popper/FindRefWrapper.d.ts +1 -1
- package/dist/umd/react-core.min.css +32 -32
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +7 -7
- package/src/components/AlertGroup/examples/AlertGroupSingularDynamic.tsx +3 -3
- package/src/components/AlertGroup/examples/AlertGroupSingularDynamicOverflow.tsx +3 -3
- package/src/components/OverflowMenu/OverflowMenu.tsx +4 -2
- package/src/components/Tabs/Tabs.tsx +2 -2
- package/src/components/Tabs/__tests__/Tabs.test.tsx +19 -0
- package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +0 -546
- package/src/components/Title/examples/Title.md +4 -50
- package/src/components/Title/examples/TitleCustomSizes.tsx +25 -0
- package/src/components/Title/examples/TitleDefaultSizes.tsx +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.241.
|
|
3
|
+
"version": "4.241.1",
|
|
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",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"generate": "node scripts/copyStyles.js"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@patternfly/react-icons": "^4.92.
|
|
48
|
-
"@patternfly/react-styles": "^4.91.
|
|
49
|
-
"@patternfly/react-tokens": "^4.93.
|
|
47
|
+
"@patternfly/react-icons": "^4.92.1",
|
|
48
|
+
"@patternfly/react-styles": "^4.91.1",
|
|
49
|
+
"@patternfly/react-tokens": "^4.93.1",
|
|
50
50
|
"focus-trap": "6.9.2",
|
|
51
51
|
"react-dropzone": "9.0.0",
|
|
52
52
|
"tippy.js": "5.1.2",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"typescript": "^4.7.4"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"react": "^16.8
|
|
71
|
-
"react-dom": "^16.8
|
|
70
|
+
"react": "^16.8 || ^17 || ^18",
|
|
71
|
+
"react-dom": "^16.8 || ^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "447aaa1f6cad3927b263c7eb737f16a4c3dde438"
|
|
74
74
|
}
|
|
@@ -24,15 +24,15 @@ export const AlertGroupSingularDynamic: React.FunctionComponent = () => {
|
|
|
24
24
|
const getUniqueId = () => new Date().getTime();
|
|
25
25
|
|
|
26
26
|
const addSuccessAlert = () => {
|
|
27
|
-
addAlert('
|
|
27
|
+
addAlert('Success alert', 'success', getUniqueId());
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const addDangerAlert = () => {
|
|
31
|
-
addAlert('
|
|
31
|
+
addAlert('Danger alert', 'danger', getUniqueId());
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const addInfoAlert = () => {
|
|
35
|
-
addAlert('
|
|
35
|
+
addAlert('Info alert', 'info', getUniqueId());
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
return (
|
|
@@ -38,15 +38,15 @@ export const AlertGroupSingularDynamicOverflow: React.FunctionComponent = () =>
|
|
|
38
38
|
const getUniqueId = () => new Date().getTime();
|
|
39
39
|
|
|
40
40
|
const addSuccessAlert = () => {
|
|
41
|
-
addAlert('
|
|
41
|
+
addAlert('Success alert', 'success', getUniqueId());
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const addDangerAlert = () => {
|
|
45
|
-
addAlert('
|
|
45
|
+
addAlert('Danger alert', 'danger', getUniqueId());
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const addInfoAlert = () => {
|
|
49
|
-
addAlert('
|
|
49
|
+
addAlert('Info alert', 'info', getUniqueId());
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
const onOverflowClick = () => {
|
|
@@ -40,13 +40,13 @@ export class OverflowMenu extends React.Component<OverflowMenuProps, OverflowMen
|
|
|
40
40
|
componentDidMount() {
|
|
41
41
|
this.handleResize();
|
|
42
42
|
if (canUseDOM) {
|
|
43
|
-
window.addEventListener('resize',
|
|
43
|
+
window.addEventListener('resize', this.handleResizeWithDelay);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
componentWillUnmount() {
|
|
48
48
|
if (canUseDOM) {
|
|
49
|
-
window.removeEventListener('resize',
|
|
49
|
+
window.removeEventListener('resize', this.handleResizeWithDelay);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -62,6 +62,8 @@ export class OverflowMenu extends React.Component<OverflowMenuProps, OverflowMen
|
|
|
62
62
|
this.setState({ isBelowBreakpoint });
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
handleResizeWithDelay = debounce(this.handleResize, 250);
|
|
66
|
+
|
|
65
67
|
render() {
|
|
66
68
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
69
|
const { className, breakpoint, children, ...props } = this.props;
|
|
@@ -461,7 +461,7 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
461
461
|
)}
|
|
462
462
|
</GenerateId>
|
|
463
463
|
)}
|
|
464
|
-
{
|
|
464
|
+
{showScrollButtons && (
|
|
465
465
|
<button
|
|
466
466
|
type="button"
|
|
467
467
|
className={css(styles.tabsScrollButton, isSecondary && buttonStyles.modifiers.secondary)}
|
|
@@ -477,7 +477,7 @@ export class Tabs extends React.Component<TabsProps, TabsState> {
|
|
|
477
477
|
{isOverflowHorizontal ? filteredChildrenWithoutOverflow : filteredChildren}
|
|
478
478
|
{hasOverflowTab && <OverflowTab overflowingTabs={overflowingTabProps} {...overflowObjectProps} />}
|
|
479
479
|
</ul>
|
|
480
|
-
{
|
|
480
|
+
{showScrollButtons && (
|
|
481
481
|
<button
|
|
482
482
|
type="button"
|
|
483
483
|
className={css(styles.tabsScrollButton, isSecondary && buttonStyles.modifiers.secondary)}
|
|
@@ -411,3 +411,22 @@ test('should render tabs with secondary border bottom when passed hasSecondaryBo
|
|
|
411
411
|
|
|
412
412
|
expect(tabsContainer).toHaveClass('pf-m-border-bottom');
|
|
413
413
|
});
|
|
414
|
+
|
|
415
|
+
test('should not render scroll buttons when isVertical is true', () => {
|
|
416
|
+
render(
|
|
417
|
+
<Tabs isVertical>
|
|
418
|
+
<Tab id="tab1" eventKey={0} title={<TabTitleText>"Tab item 1"</TabTitleText>}>
|
|
419
|
+
Tab 1 section
|
|
420
|
+
</Tab>
|
|
421
|
+
<Tab id="tab2" eventKey={1} title={<TabTitleText>"Tab item 2"</TabTitleText>}>
|
|
422
|
+
Tab 2 section
|
|
423
|
+
</Tab>
|
|
424
|
+
<Tab id="tab3" eventKey={2} title={<TabTitleText>"Tab item 3"</TabTitleText>}>
|
|
425
|
+
Tab 3 section
|
|
426
|
+
</Tab>
|
|
427
|
+
</Tabs>
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
expect(screen.queryByLabelText('Scroll left')).not.toBeInTheDocument();
|
|
431
|
+
expect(screen.queryByLabelText('Scroll right')).not.toBeInTheDocument();
|
|
432
|
+
})
|