@patternfly/react-core 4.235.7 → 4.236.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 +27 -0
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.js +1 -0
- package/dist/esm/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Page/PageSection.d.ts +2 -0
- package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSection.js +3 -2
- package/dist/esm/components/Page/PageSection.js.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.d.ts.map +1 -1
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.js +1 -0
- package/dist/js/components/ApplicationLauncher/ApplicationLauncher.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Page/PageSection.d.ts +2 -0
- package/dist/js/components/Page/PageSection.d.ts.map +1 -1
- package/dist/js/components/Page/PageSection.js +3 -2
- package/dist/js/components/Page/PageSection.js.map +1 -1
- package/dist/umd/react-core.min.css +480 -480
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +5 -5
- package/src/components/ApplicationLauncher/ApplicationLauncher.tsx +1 -0
- package/src/components/Dropdown/__tests__/Dropdown.test.tsx +1 -1
- package/src/components/Dropdown/examples/DropdownPrimaryToggle.tsx +1 -1
- package/src/components/MenuToggle/MenuToggle.tsx +7 -1
- package/src/components/Page/PageSection.tsx +7 -2
- package/src/components/Page/__tests__/PageSection.test.tsx +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.236.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.
|
|
48
|
-
"@patternfly/react-styles": "^4.
|
|
49
|
-
"@patternfly/react-tokens": "^4.
|
|
47
|
+
"@patternfly/react-icons": "^4.87.1",
|
|
48
|
+
"@patternfly/react-styles": "^4.86.1",
|
|
49
|
+
"@patternfly/react-tokens": "^4.88.1",
|
|
50
50
|
"focus-trap": "6.9.2",
|
|
51
51
|
"react-dropzone": "9.0.0",
|
|
52
52
|
"tippy.js": "5.1.2",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": "^16.8.0 || ^17.0.0",
|
|
71
71
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "1e8f4121716891c90191b948a66eccf167f404ce"
|
|
74
74
|
}
|
|
@@ -70,6 +70,7 @@ export class ApplicationLauncher extends React.Component<ApplicationLauncherProp
|
|
|
70
70
|
isDisabled: false,
|
|
71
71
|
direction: DropdownDirection.down,
|
|
72
72
|
favorites: [] as string[],
|
|
73
|
+
items: [] as React.ReactNode[],
|
|
73
74
|
isOpen: false,
|
|
74
75
|
position: DropdownPosition.left,
|
|
75
76
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
@@ -46,7 +46,7 @@ export const DropdownPrimaryToggle: React.FunctionComponent = () => {
|
|
|
46
46
|
<Dropdown
|
|
47
47
|
onSelect={onSelect}
|
|
48
48
|
toggle={
|
|
49
|
-
<DropdownToggle id="toggle-primary"
|
|
49
|
+
<DropdownToggle id="toggle-primary" toggleVariant="primary" onToggle={onToggle}>
|
|
50
50
|
Dropdown
|
|
51
51
|
</DropdownToggle>
|
|
52
52
|
}
|
|
@@ -124,7 +124,13 @@ export class MenuToggleBase extends React.Component<MenuToggleProps> {
|
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
if (isTypeahead) {
|
|
127
|
-
return
|
|
127
|
+
return (
|
|
128
|
+
<div
|
|
129
|
+
ref={innerRef as React.Ref<HTMLDivElement>}
|
|
130
|
+
className={css(commonStyles, styles.modifiers.typeahead)}
|
|
131
|
+
{...componentProps}
|
|
132
|
+
/>
|
|
133
|
+
);
|
|
128
134
|
}
|
|
129
135
|
|
|
130
136
|
if (splitButtonOptions) {
|
|
@@ -65,6 +65,8 @@ export interface PageSectionProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
65
65
|
* This prop should also be passed in if a heading is not being used to describe the content of the page section.
|
|
66
66
|
*/
|
|
67
67
|
'aria-label'?: string;
|
|
68
|
+
/** Sets the base component to render. Defaults to section */
|
|
69
|
+
component?: keyof JSX.IntrinsicElements;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
const variantType = {
|
|
@@ -98,6 +100,7 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
|
|
|
98
100
|
hasShadowBottom = false,
|
|
99
101
|
hasOverflowScroll = false,
|
|
100
102
|
'aria-label': ariaLabel,
|
|
103
|
+
component = 'section',
|
|
101
104
|
...props
|
|
102
105
|
}: PageSectionProps) => {
|
|
103
106
|
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
@@ -109,8 +112,10 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
|
|
|
109
112
|
}
|
|
110
113
|
}, [hasOverflowScroll, ariaLabel]);
|
|
111
114
|
|
|
115
|
+
const Component = component as any;
|
|
116
|
+
|
|
112
117
|
return (
|
|
113
|
-
<
|
|
118
|
+
<Component
|
|
114
119
|
{...props}
|
|
115
120
|
className={css(
|
|
116
121
|
variantType[type],
|
|
@@ -133,7 +138,7 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
|
|
|
133
138
|
>
|
|
134
139
|
{isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
|
|
135
140
|
{!isWidthLimited && children}
|
|
136
|
-
</
|
|
141
|
+
</Component>
|
|
137
142
|
);
|
|
138
143
|
};
|
|
139
144
|
PageSection.displayName = 'PageSection';
|
|
@@ -128,3 +128,15 @@ test('Logs a warning in the console when an aria-label is not included with hasO
|
|
|
128
128
|
|
|
129
129
|
expect(consoleWarning).toHaveBeenCalled();
|
|
130
130
|
});
|
|
131
|
+
|
|
132
|
+
test('Renders as a section by default', () => {
|
|
133
|
+
render(<PageSection>test</PageSection>);
|
|
134
|
+
|
|
135
|
+
expect(screen.getByText('test')).toHaveProperty('nodeName', 'SECTION');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test('Renders as other elements when a different element type is passed using the component prop', () => {
|
|
139
|
+
render(<PageSection component="main">test</PageSection>);
|
|
140
|
+
|
|
141
|
+
expect(screen.getByRole('main')).toHaveTextContent('test');
|
|
142
|
+
});
|