@patternfly/react-core 4.198.13 → 4.198.16
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 +27 -0
- package/dist/esm/components/Form/FormFieldGroup.d.ts +1 -1
- package/dist/esm/components/Form/FormFieldGroupExpandable.d.ts +2 -2
- package/dist/esm/components/Form/FormFieldGroupHeader.d.ts +3 -1
- package/dist/esm/components/Form/FormFieldGroupHeader.d.ts.map +1 -1
- package/dist/esm/components/Form/FormFieldGroupHeader.js.map +1 -1
- package/dist/esm/components/Form/InternalFormFieldGroup.d.ts +2 -2
- package/dist/esm/components/NotificationDrawer/NotificationDrawer.d.ts +3 -1
- package/dist/esm/components/NotificationDrawer/NotificationDrawer.d.ts.map +1 -1
- package/dist/esm/components/NotificationDrawer/NotificationDrawer.js +4 -3
- package/dist/esm/components/NotificationDrawer/NotificationDrawer.js.map +1 -1
- package/dist/esm/components/Tabs/Tab.d.ts +3 -1
- package/dist/esm/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tab.js +4 -3
- package/dist/esm/components/Tabs/Tab.js.map +1 -1
- package/dist/esm/components/Tabs/TabButton.d.ts +2 -0
- package/dist/esm/components/Tabs/TabButton.d.ts.map +1 -1
- package/dist/esm/components/Tabs/TabButton.js +2 -2
- package/dist/esm/components/Tabs/TabButton.js.map +1 -1
- package/dist/esm/components/Tile/Tile.d.ts.map +1 -1
- package/dist/esm/components/Tile/Tile.js +1 -1
- package/dist/esm/components/Tile/Tile.js.map +1 -1
- package/dist/js/components/Form/FormFieldGroup.d.ts +1 -1
- package/dist/js/components/Form/FormFieldGroupExpandable.d.ts +2 -2
- package/dist/js/components/Form/FormFieldGroupHeader.d.ts +3 -1
- package/dist/js/components/Form/FormFieldGroupHeader.d.ts.map +1 -1
- package/dist/js/components/Form/FormFieldGroupHeader.js.map +1 -1
- package/dist/js/components/Form/InternalFormFieldGroup.d.ts +2 -2
- package/dist/js/components/NotificationDrawer/NotificationDrawer.d.ts +3 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawer.d.ts.map +1 -1
- package/dist/js/components/NotificationDrawer/NotificationDrawer.js +4 -4
- package/dist/js/components/NotificationDrawer/NotificationDrawer.js.map +1 -1
- package/dist/js/components/Tabs/Tab.d.ts +3 -1
- package/dist/js/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tab.js +4 -3
- package/dist/js/components/Tabs/Tab.js.map +1 -1
- package/dist/js/components/Tabs/TabButton.d.ts +2 -0
- package/dist/js/components/Tabs/TabButton.d.ts.map +1 -1
- package/dist/js/components/Tabs/TabButton.js +2 -2
- package/dist/js/components/Tabs/TabButton.js.map +1 -1
- package/dist/js/components/Tile/Tile.d.ts.map +1 -1
- package/dist/js/components/Tile/Tile.js +1 -1
- package/dist/js/components/Tile/Tile.js.map +1 -1
- package/dist/umd/react-core.js +10 -9
- package/dist/umd/react-core.min.css +72 -72
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/Form/FormFieldGroup.tsx +1 -1
- package/src/components/Form/FormFieldGroupExpandable.tsx +2 -2
- package/src/components/Form/FormFieldGroupHeader.tsx +5 -1
- package/src/components/Form/InternalFormFieldGroup.tsx +2 -2
- package/src/components/Form/__tests__/FormFieldGroup.test.tsx +1 -1
- package/src/components/Form/__tests__/__snapshots__/FormFieldGroup.test.tsx.snap +1 -1
- package/src/components/Form/examples/Form.md +1 -1
- package/src/components/NotificationDrawer/NotificationDrawer.tsx +8 -2
- package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawer.test.tsx.snap +1 -1
- package/src/components/Tabs/Tab.tsx +31 -24
- package/src/components/Tabs/TabButton.tsx +5 -1
- package/src/components/Tabs/examples/Tabs.md +527 -256
- package/src/components/Tile/Tile.tsx +3 -0
- package/src/components/Tile/__tests__/__snapshots__/Tile.test.tsx.snap +9 -0
- package/src/components/Tile/examples/Tile.md +41 -39
- package/src/demos/ComposableMenu/ComposableMenu.md +4 -9
- package/src/demos/ComposableMenu/examples/ComposableDateSelect.tsx +113 -0
- package/src/demos/NotificationDrawer/NotificationDrawer.md +26 -2
- package/src/demos/TileDemo.md +17 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.198.
|
|
3
|
+
"version": "4.198.16",
|
|
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.49.
|
|
38
|
-
"@patternfly/react-styles": "^4.48.
|
|
39
|
-
"@patternfly/react-tokens": "^4.50.
|
|
37
|
+
"@patternfly/react-icons": "^4.49.16",
|
|
38
|
+
"@patternfly/react-styles": "^4.48.16",
|
|
39
|
+
"@patternfly/react-tokens": "^4.50.16",
|
|
40
40
|
"focus-trap": "6.2.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": "752c9d1a3638f356f2e68f670e79356f03ebea8e"
|
|
64
64
|
}
|
|
@@ -6,7 +6,7 @@ export interface FormFieldGroupProps extends Omit<React.HTMLProps<HTMLDivElement
|
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
/** Additional classes added to the form field group. */
|
|
8
8
|
className?: string;
|
|
9
|
-
/** Form
|
|
9
|
+
/** Form field group header */
|
|
10
10
|
header?: React.ReactNode;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -7,11 +7,11 @@ export interface FormFieldGroupExpandableProps extends React.HTMLProps<HTMLDivEl
|
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
/** Additional classes added to the form field group. */
|
|
9
9
|
className?: string;
|
|
10
|
-
/** Form
|
|
10
|
+
/** Form field group header */
|
|
11
11
|
header?: React.ReactNode;
|
|
12
12
|
/** Flag indicating if the form field group is initially expanded */
|
|
13
13
|
isExpanded?: boolean;
|
|
14
|
-
/** Aria-label to use on the form
|
|
14
|
+
/** Aria-label to use on the form field group toggle button */
|
|
15
15
|
toggleAriaLabel?: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -2,17 +2,21 @@ import * as React from 'react';
|
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Form/form';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
|
|
5
|
+
// typo - rename to FormFieldGroupHeaderTitleTextObject during breaking change release
|
|
5
6
|
export interface FormFiledGroupHeaderTitleTextObject {
|
|
6
7
|
/** Title text. */
|
|
7
8
|
text: React.ReactNode;
|
|
8
9
|
/** The applied to the title div for accessibility */
|
|
9
10
|
id: string;
|
|
10
11
|
}
|
|
12
|
+
|
|
13
|
+
export interface FormFieldGroupHeaderTitleTextObject extends FormFiledGroupHeaderTitleTextObject {}
|
|
14
|
+
|
|
11
15
|
export interface FormFieldGroupHeaderProps extends React.HTMLProps<HTMLDivElement> {
|
|
12
16
|
/** Additional classes added to the section */
|
|
13
17
|
className?: string;
|
|
14
18
|
/** Field group header title text */
|
|
15
|
-
titleText?:
|
|
19
|
+
titleText?: FormFieldGroupHeaderTitleTextObject;
|
|
16
20
|
/** Field group header title description */
|
|
17
21
|
titleDescription?: React.ReactNode;
|
|
18
22
|
/** Field group header actions */
|
|
@@ -9,7 +9,7 @@ export interface InternalFormFieldGroupProps extends Omit<React.HTMLProps<HTMLDi
|
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
/** Additional classes added to the form field group. */
|
|
11
11
|
className?: string;
|
|
12
|
-
/** Form
|
|
12
|
+
/** Form field group header */
|
|
13
13
|
header?: any;
|
|
14
14
|
/** Flag indicating if the field group is expandable */
|
|
15
15
|
isExpandable?: boolean;
|
|
@@ -17,7 +17,7 @@ export interface InternalFormFieldGroupProps extends Omit<React.HTMLProps<HTMLDi
|
|
|
17
17
|
isExpanded?: boolean;
|
|
18
18
|
/** Function callback called when user clicks toggle button */
|
|
19
19
|
onToggle?: () => void;
|
|
20
|
-
/** Aria-label to use on the form
|
|
20
|
+
/** Aria-label to use on the form field group toggle button */
|
|
21
21
|
toggleAriaLabel?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -5,7 +5,7 @@ import { FormFieldGroupHeader } from '../FormFieldGroupHeader';
|
|
|
5
5
|
import { Button } from '../../Button';
|
|
6
6
|
import { render } from '@testing-library/react';
|
|
7
7
|
|
|
8
|
-
test('Check form
|
|
8
|
+
test('Check form field group example against snapshot', () => {
|
|
9
9
|
const FieldGroup = (
|
|
10
10
|
<FormFieldGroup
|
|
11
11
|
header={
|
|
@@ -85,7 +85,7 @@ exports[`Check expandable form field group example against snapshot 1`] = `
|
|
|
85
85
|
</div>
|
|
86
86
|
`;
|
|
87
87
|
|
|
88
|
-
exports[`Check form
|
|
88
|
+
exports[`Check form field group example against snapshot 1`] = `
|
|
89
89
|
<div>
|
|
90
90
|
<div
|
|
91
91
|
class="pf-c-form__field-group"
|
|
@@ -8,15 +8,21 @@ export interface NotificationDrawerProps extends React.HTMLProps<HTMLDivElement>
|
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
/** Additional classes added to the notification drawer */
|
|
10
10
|
className?: string;
|
|
11
|
+
/** @hide Forwarded ref */
|
|
12
|
+
innerRef?: React.Ref<any>;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
const NotificationDrawerBase: React.FunctionComponent<NotificationDrawerProps> = ({
|
|
14
16
|
children,
|
|
15
17
|
className = '',
|
|
18
|
+
innerRef,
|
|
16
19
|
...props
|
|
17
20
|
}: NotificationDrawerProps) => (
|
|
18
|
-
<div {...props} className={css(styles.notificationDrawer, className)}>
|
|
21
|
+
<div ref={innerRef} {...props} className={css(styles.notificationDrawer, className)}>
|
|
19
22
|
{children}
|
|
20
23
|
</div>
|
|
21
24
|
);
|
|
25
|
+
export const NotificationDrawer = React.forwardRef((props: NotificationDrawerProps, ref: React.Ref<any>) => (
|
|
26
|
+
<NotificationDrawerBase innerRef={ref} {...props} />
|
|
27
|
+
));
|
|
22
28
|
NotificationDrawer.displayName = 'NotificationDrawer';
|
package/src/components/NotificationDrawer/__tests__/__snapshots__/NotificationDrawer.test.tsx.snap
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`className is added to the root element 1`] = `"
|
|
3
|
+
exports[`className is added to the root element 1`] = `"extra-class"`;
|
|
4
4
|
|
|
5
5
|
exports[`renders with PatternFly Core styles 1`] = `
|
|
6
6
|
<div>
|
|
@@ -4,6 +4,7 @@ import { OUIAProps } from '../../helpers';
|
|
|
4
4
|
import { TabButton } from './TabButton';
|
|
5
5
|
import { TabsContext } from './TabsContext';
|
|
6
6
|
import { css } from '@patternfly/react-styles';
|
|
7
|
+
import { Tooltip } from '../Tooltip';
|
|
7
8
|
|
|
8
9
|
export interface TabProps extends Omit<React.HTMLProps<HTMLAnchorElement | HTMLButtonElement>, 'title'>, OUIAProps {
|
|
9
10
|
/** content rendered inside the Tab content area. */
|
|
@@ -30,6 +31,8 @@ export interface TabProps extends Omit<React.HTMLProps<HTMLAnchorElement | HTMLB
|
|
|
30
31
|
inoperableEvents?: string[];
|
|
31
32
|
/** Forwarded ref */
|
|
32
33
|
innerRef?: React.Ref<any>;
|
|
34
|
+
/** Optional Tooltip rendered to a Tab. Should be <Tooltip> with appropriate props for proper rendering. */
|
|
35
|
+
tooltip?: React.ReactElement<any>;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
const TabBase: React.FunctionComponent<TabProps> = ({
|
|
@@ -45,6 +48,7 @@ const TabBase: React.FunctionComponent<TabProps> = ({
|
|
|
45
48
|
inoperableEvents = ['onClick', 'onKeyPress'],
|
|
46
49
|
href,
|
|
47
50
|
innerRef,
|
|
51
|
+
tooltip,
|
|
48
52
|
...props
|
|
49
53
|
}: TabProps) => {
|
|
50
54
|
const preventedEvents = inoperableEvents.reduce(
|
|
@@ -69,31 +73,34 @@ const TabBase: React.FunctionComponent<TabProps> = ({
|
|
|
69
73
|
return null;
|
|
70
74
|
}
|
|
71
75
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
|
|
77
|
+
const tabButton = (
|
|
78
|
+
<TabButton
|
|
79
|
+
parentInnerRef={innerRef}
|
|
80
|
+
className={css(
|
|
81
|
+
styles.tabsLink,
|
|
82
|
+
isDisabled && href && styles.modifiers.disabled,
|
|
83
|
+
isAriaDisabled && styles.modifiers.ariaDisabled
|
|
84
|
+
)}
|
|
85
|
+
disabled={isButtonElement ? isDisabled : null}
|
|
86
|
+
aria-disabled={isDisabled || isAriaDisabled}
|
|
87
|
+
tabIndex={getDefaultTabIdx()}
|
|
88
|
+
onClick={(event: any) => handleTabClick(event, eventKey, tabContentRef)}
|
|
89
|
+
{...(isAriaDisabled ? preventedEvents : null)}
|
|
90
|
+
id={`pf-tab-${eventKey}-${childId || uniqueId}`}
|
|
91
|
+
aria-controls={ariaControls}
|
|
92
|
+
tabContentRef={tabContentRef}
|
|
93
|
+
ouiaId={childOuiaId}
|
|
94
|
+
href={href}
|
|
95
|
+
{...props}
|
|
76
96
|
>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
aria-disabled={isDisabled || isAriaDisabled}
|
|
85
|
-
tabIndex={getDefaultTabIdx()}
|
|
86
|
-
onClick={(event: any) => handleTabClick(event, eventKey, tabContentRef)}
|
|
87
|
-
{...(isAriaDisabled ? preventedEvents : null)}
|
|
88
|
-
id={`pf-tab-${eventKey}-${childId || uniqueId}`}
|
|
89
|
-
aria-controls={ariaControls}
|
|
90
|
-
tabContentRef={tabContentRef}
|
|
91
|
-
ouiaId={childOuiaId}
|
|
92
|
-
href={href}
|
|
93
|
-
{...props}
|
|
94
|
-
>
|
|
95
|
-
{title}
|
|
96
|
-
</TabButton>
|
|
97
|
+
{title}
|
|
98
|
+
</TabButton>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<li className={css(styles.tabsItem, eventKey === localActiveKey && styles.modifiers.current, childClassName)}>
|
|
103
|
+
{tooltip ? <Tooltip {...tooltip.props}>{tabButton}</Tooltip> : tabButton}
|
|
97
104
|
</li>
|
|
98
105
|
);
|
|
99
106
|
};
|
|
@@ -10,6 +10,8 @@ export interface TabButtonProps extends Omit<React.HTMLProps<HTMLAnchorElement |
|
|
|
10
10
|
href?: string;
|
|
11
11
|
/** child reference for case in which a TabContent section is defined outside of a Tabs component */
|
|
12
12
|
tabContentRef?: React.Ref<any>;
|
|
13
|
+
/** Parents' innerRef passed down for properly displaying Tooltips */
|
|
14
|
+
parentInnerRef?: React.Ref<any>;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export const TabButton: React.FunctionComponent<TabButtonProps> = ({
|
|
@@ -17,12 +19,14 @@ export const TabButton: React.FunctionComponent<TabButtonProps> = ({
|
|
|
17
19
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
20
|
tabContentRef,
|
|
19
21
|
ouiaId,
|
|
22
|
+
parentInnerRef,
|
|
20
23
|
ouiaSafe,
|
|
21
24
|
...props
|
|
22
25
|
}: TabButtonProps) => {
|
|
23
26
|
const Component = (props.href ? 'a' : 'button') as any;
|
|
27
|
+
|
|
24
28
|
return (
|
|
25
|
-
<Component {...getOUIAProps(TabButton.displayName, ouiaId, ouiaSafe)} {...props}>
|
|
29
|
+
<Component ref={parentInnerRef} {...getOUIAProps(TabButton.displayName, ouiaId, ouiaSafe)} {...props}>
|
|
26
30
|
{children}
|
|
27
31
|
</Component>
|
|
28
32
|
);
|