@patternfly/react-core 6.3.1-prerelease.0 → 6.3.1-prerelease.2
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 +12 -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/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/Content/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/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/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/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/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -1
- package/dist/dynamic/deprecated/components/Tile/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/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/styles/package.json +1 -1
- package/dist/esm/components/Label/LabelGroup.js +2 -2
- package/dist/esm/components/Label/LabelGroup.js.map +1 -1
- package/dist/esm/components/Page/PageToggleButton.d.ts +2 -0
- package/dist/esm/components/Page/PageToggleButton.d.ts.map +1 -1
- package/dist/esm/components/Page/PageToggleButton.js +4 -2
- package/dist/esm/components/Page/PageToggleButton.js.map +1 -1
- package/dist/js/components/Label/LabelGroup.js +2 -2
- package/dist/js/components/Label/LabelGroup.js.map +1 -1
- package/dist/js/components/Page/PageToggleButton.d.ts +2 -0
- package/dist/js/components/Page/PageToggleButton.d.ts.map +1 -1
- package/dist/js/components/Page/PageToggleButton.js +4 -2
- package/dist/js/components/Page/PageToggleButton.js.map +1 -1
- package/dist/umd/assets/{output-CQ44UfaW.css → output-mLkegqf5.css} +19043 -19043
- 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 +2 -2
- package/src/components/Label/LabelGroup.tsx +3 -3
- package/src/components/Label/__tests__/__snapshots__/LabelGroup.test.tsx.snap +3 -3
- package/src/components/Page/PageToggleButton.tsx +7 -0
- package/src/components/Page/__tests__/PageToggleButton.test.tsx +74 -0
- package/src/components/Toolbar/__tests__/__snapshots__/Toolbar.test.tsx.snap +3 -3
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.3.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.3.1-prerelease.1","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.3.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.3.1-prerelease.1","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.3.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.3.1-prerelease.1","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.3.1-prerelease.
|
|
3
|
+
"version": "6.3.1-prerelease.2",
|
|
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",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"react": "^17 || ^18 || ^19",
|
|
64
64
|
"react-dom": "^17 || ^18 || ^19"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "8d65eb8ad40d4d01963d6c3280f48fe3cd709056"
|
|
67
67
|
}
|
|
@@ -5,7 +5,7 @@ import { css } from '@patternfly/react-styles';
|
|
|
5
5
|
import { Button } from '../Button';
|
|
6
6
|
import { Label } from './Label';
|
|
7
7
|
import { Tooltip, TooltipPosition } from '../Tooltip';
|
|
8
|
-
import
|
|
8
|
+
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
9
9
|
import { fillTemplate } from '../../helpers';
|
|
10
10
|
import { GenerateId } from '../../helpers/GenerateId/GenerateId';
|
|
11
11
|
|
|
@@ -205,12 +205,12 @@ class LabelGroup extends Component<LabelGroupProps, LabelGroupState> {
|
|
|
205
205
|
<div className={css(styles.labelGroupClose)}>
|
|
206
206
|
<Button
|
|
207
207
|
variant="plain"
|
|
208
|
-
|
|
208
|
+
size="sm"
|
|
209
209
|
aria-label={closeBtnAriaLabel}
|
|
210
210
|
onClick={onClick}
|
|
211
211
|
id={`remove_group_${id}`}
|
|
212
212
|
aria-labelledby={`remove_group_${id} ${id}`}
|
|
213
|
-
icon={<
|
|
213
|
+
icon={<TimesIcon />}
|
|
214
214
|
/>
|
|
215
215
|
</div>
|
|
216
216
|
);
|
|
@@ -255,7 +255,7 @@ exports[`LabelGroup label group with closable category 1`] = `
|
|
|
255
255
|
<button
|
|
256
256
|
aria-label="Close label group"
|
|
257
257
|
aria-labelledby="remove_group_generated-id generated-id"
|
|
258
|
-
class="pf-v6-c-button pf-m-plain pf-m-
|
|
258
|
+
class="pf-v6-c-button pf-m-plain pf-m-small"
|
|
259
259
|
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
260
260
|
data-ouia-component-type="PF6/Button"
|
|
261
261
|
data-ouia-safe="true"
|
|
@@ -271,11 +271,11 @@ exports[`LabelGroup label group with closable category 1`] = `
|
|
|
271
271
|
fill="currentColor"
|
|
272
272
|
height="1em"
|
|
273
273
|
role="img"
|
|
274
|
-
viewBox="0 0
|
|
274
|
+
viewBox="0 0 352 512"
|
|
275
275
|
width="1em"
|
|
276
276
|
>
|
|
277
277
|
<path
|
|
278
|
-
d="
|
|
278
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
279
279
|
/>
|
|
280
280
|
</svg>
|
|
281
281
|
</span>
|
|
@@ -14,6 +14,8 @@ export interface PageToggleButtonProps extends ButtonProps {
|
|
|
14
14
|
'aria-label'?: string;
|
|
15
15
|
/** Flag indicating whether the hamburger button variation with animations should be used. */
|
|
16
16
|
isHamburgerButton?: boolean;
|
|
17
|
+
/** IsHamburgerButton must be true for hamburgerVariant to be have an effect. Adjusts and animates the hamburger icon to indicate what will happen upon clicking the button. */
|
|
18
|
+
hamburgerVariant?: 'expand' | 'collapse';
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export const PageToggleButton: React.FunctionComponent<PageToggleButtonProps> = ({
|
|
@@ -23,6 +25,7 @@ export const PageToggleButton: React.FunctionComponent<PageToggleButtonProps> =
|
|
|
23
25
|
id = 'nav-toggle',
|
|
24
26
|
'aria-label': ariaLabel = 'Side navigation toggle',
|
|
25
27
|
isHamburgerButton,
|
|
28
|
+
hamburgerVariant,
|
|
26
29
|
...props
|
|
27
30
|
}: PageToggleButtonProps) => (
|
|
28
31
|
<PageContextConsumer>
|
|
@@ -42,6 +45,10 @@ export const PageToggleButton: React.FunctionComponent<PageToggleButtonProps> =
|
|
|
42
45
|
aria-expanded={sidebarOpen ? 'true' : 'false'}
|
|
43
46
|
variant={ButtonVariant.plain}
|
|
44
47
|
isHamburger={isHamburgerButton}
|
|
48
|
+
hamburgerVariant={hamburgerVariant}
|
|
49
|
+
{...(isHamburgerButton && {
|
|
50
|
+
isExpanded: sidebarOpen
|
|
51
|
+
})}
|
|
45
52
|
{...props}
|
|
46
53
|
>
|
|
47
54
|
{!isHamburgerButton && children}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { PageToggleButton } from '../PageToggleButton';
|
|
3
|
+
import { PageContextProvider } from '../PageContext';
|
|
4
|
+
|
|
5
|
+
test('Renders without children', () => {
|
|
6
|
+
render(
|
|
7
|
+
<div data-testid="container">
|
|
8
|
+
<PageToggleButton />
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
expect(screen.getByTestId('container').firstChild).toBeVisible();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('Renders with children', () => {
|
|
16
|
+
render(<PageToggleButton>Test</PageToggleButton>);
|
|
17
|
+
|
|
18
|
+
expect(screen.getByText('Test')).toBeVisible();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('Throws console error when isHamburger is true and isSidebarOpen is not passed', () => {
|
|
22
|
+
const consoleError = jest.spyOn(console, 'error').mockImplementation();
|
|
23
|
+
|
|
24
|
+
render(<PageToggleButton isHamburger aria-label="Test" />);
|
|
25
|
+
|
|
26
|
+
expect(consoleError).toHaveBeenCalledWith(
|
|
27
|
+
'Button: when the isHamburger property is passed in, you must also pass in a boolean value to the isExpanded property. It is expected that a hamburger button controls the expansion of other content.'
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('Does not throw console error when isHamburger is true and isSidebarOpen is false', () => {
|
|
32
|
+
const consoleError = jest.spyOn(console, 'error').mockImplementation();
|
|
33
|
+
|
|
34
|
+
render(<PageToggleButton isSidebarOpen={false} isHamburger aria-label="Test" />);
|
|
35
|
+
|
|
36
|
+
expect(consoleError).not.toHaveBeenCalledWith(
|
|
37
|
+
'Button: when the isHamburger property is passed in, you must also pass in a boolean value to the isExpanded property. It is expected that a hamburger button controls the expansion of other content..'
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('Does not throw console error when isHamburger is true and isSidebarOpen is true', () => {
|
|
42
|
+
const consoleError = jest.spyOn(console, 'error').mockImplementation();
|
|
43
|
+
|
|
44
|
+
render(<PageToggleButton isSidebarOpen isHamburger aria-label="Test" />);
|
|
45
|
+
|
|
46
|
+
expect(consoleError).not.toHaveBeenCalledWith(
|
|
47
|
+
'Button: when the isHamburger property is passed in, you must also pass in a boolean value to the isExpanded property. It is expected that a hamburger button controls the expansion of other content..'
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// assisted by AI/Cursor
|
|
52
|
+
test('Does not throw console error when isHamburger is true, isSidebarOpen is not passed, but managedIsSidebarOpen is true', () => {
|
|
53
|
+
const consoleError = jest.spyOn(console, 'error').mockImplementation();
|
|
54
|
+
|
|
55
|
+
const mockPageContext = {
|
|
56
|
+
isManagedSidebar: true,
|
|
57
|
+
onSidebarToggle: () => null,
|
|
58
|
+
isSidebarOpen: true, // managedIsSidebarOpen is true
|
|
59
|
+
width: 1024,
|
|
60
|
+
height: 768,
|
|
61
|
+
getBreakpoint: () => 'lg' as const,
|
|
62
|
+
getVerticalBreakpoint: () => 'lg' as const
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
render(
|
|
66
|
+
<PageContextProvider value={mockPageContext}>
|
|
67
|
+
<PageToggleButton isHamburger aria-label="Test" />
|
|
68
|
+
</PageContextProvider>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
expect(consoleError).not.toHaveBeenCalledWith(
|
|
72
|
+
'Button: when the isHamburger property is passed in, you must also pass in a boolean value to the isExpanded property. It is expected that a hamburger button controls the expansion of other content..'
|
|
73
|
+
);
|
|
74
|
+
});
|
|
@@ -225,7 +225,7 @@ exports[`Toolbar should render with custom label content 1`] = `
|
|
|
225
225
|
<button
|
|
226
226
|
aria-label="Close label group"
|
|
227
227
|
aria-labelledby="remove_group_generated-id generated-id"
|
|
228
|
-
class="pf-v6-c-button pf-m-plain pf-m-
|
|
228
|
+
class="pf-v6-c-button pf-m-plain pf-m-small"
|
|
229
229
|
data-ouia-component-id="OUIA-Generated-Button-plain-4"
|
|
230
230
|
data-ouia-component-type="PF6/Button"
|
|
231
231
|
data-ouia-safe="true"
|
|
@@ -241,11 +241,11 @@ exports[`Toolbar should render with custom label content 1`] = `
|
|
|
241
241
|
fill="currentColor"
|
|
242
242
|
height="1em"
|
|
243
243
|
role="img"
|
|
244
|
-
viewBox="0 0
|
|
244
|
+
viewBox="0 0 352 512"
|
|
245
245
|
width="1em"
|
|
246
246
|
>
|
|
247
247
|
<path
|
|
248
|
-
d="
|
|
248
|
+
d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"
|
|
249
249
|
/>
|
|
250
250
|
</svg>
|
|
251
251
|
</span>
|