@patternfly/react-core 6.5.0-prerelease.1 → 6.5.0-prerelease.3
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 +17 -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/Compass/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/AnimationsProvider/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/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/Drawer/Drawer.d.ts +2 -0
- package/dist/esm/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/esm/components/Drawer/Drawer.js +2 -2
- package/dist/esm/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts +4 -2
- package/dist/esm/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js +2 -1
- package/dist/esm/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/esm/components/Page/Page.d.ts.map +1 -1
- package/dist/esm/components/Page/Page.js +1 -0
- package/dist/esm/components/Page/Page.js.map +1 -1
- package/dist/esm/components/Page/PageContext.d.ts +1 -0
- package/dist/esm/components/Page/PageContext.d.ts.map +1 -1
- package/dist/esm/components/Page/PageContext.js +1 -0
- package/dist/esm/components/Page/PageContext.js.map +1 -1
- package/dist/esm/components/Page/PageSidebar.js +2 -2
- package/dist/esm/components/Page/PageSidebar.js.map +1 -1
- package/dist/esm/components/Progress/Progress.d.ts +2 -0
- package/dist/esm/components/Progress/Progress.d.ts.map +1 -1
- package/dist/esm/components/Progress/Progress.js +2 -2
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Progress/ProgressContainer.d.ts +2 -0
- package/dist/esm/components/Progress/ProgressContainer.d.ts.map +1 -1
- package/dist/esm/components/Progress/ProgressContainer.js +2 -2
- package/dist/esm/components/Progress/ProgressContainer.js.map +1 -1
- package/dist/js/components/Drawer/Drawer.d.ts +2 -0
- package/dist/js/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/js/components/Drawer/Drawer.js +2 -2
- package/dist/js/components/Drawer/Drawer.js.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts +4 -2
- package/dist/js/components/ExpandableSection/ExpandableSection.d.ts.map +1 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js +2 -1
- package/dist/js/components/ExpandableSection/ExpandableSection.js.map +1 -1
- package/dist/js/components/Page/Page.d.ts.map +1 -1
- package/dist/js/components/Page/Page.js +1 -0
- package/dist/js/components/Page/Page.js.map +1 -1
- package/dist/js/components/Page/PageContext.d.ts +1 -0
- package/dist/js/components/Page/PageContext.d.ts.map +1 -1
- package/dist/js/components/Page/PageContext.js +1 -0
- package/dist/js/components/Page/PageContext.js.map +1 -1
- package/dist/js/components/Page/PageSidebar.js +2 -2
- package/dist/js/components/Page/PageSidebar.js.map +1 -1
- package/dist/js/components/Progress/Progress.d.ts +2 -0
- package/dist/js/components/Progress/Progress.d.ts.map +1 -1
- package/dist/js/components/Progress/Progress.js +2 -2
- package/dist/js/components/Progress/Progress.js.map +1 -1
- package/dist/js/components/Progress/ProgressContainer.d.ts +2 -0
- package/dist/js/components/Progress/ProgressContainer.d.ts.map +1 -1
- package/dist/js/components/Progress/ProgressContainer.js +2 -2
- package/dist/js/components/Progress/ProgressContainer.js.map +1 -1
- package/dist/umd/assets/{output-COsUhzfR.css → output-b6v4lKPy.css} +20003 -19971
- package/dist/umd/react-core.min.js +3 -3
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +6 -6
- package/src/components/Drawer/Drawer.tsx +4 -0
- package/src/components/Drawer/__tests__/Drawer.test.tsx +26 -1
- package/src/components/Drawer/examples/Drawer.md +13 -0
- package/src/components/Drawer/examples/DrawerBasicPill.tsx +57 -0
- package/src/components/Drawer/examples/DrawerPillInline.tsx +57 -0
- package/src/components/ExpandableSection/ExpandableSection.tsx +8 -3
- package/src/components/ExpandableSection/__tests__/ExpandableSection.test.tsx +34 -0
- package/src/components/ExpandableSection/examples/ExpandableSection.md +8 -0
- package/src/components/ExpandableSection/examples/ExpandableSectionUncontrolledDynamicToggleFunction.tsx +13 -0
- package/src/components/Page/Page.tsx +1 -0
- package/src/components/Page/PageContext.tsx +2 -0
- package/src/components/Page/PageSidebar.tsx +2 -2
- package/src/components/Page/__tests__/Generated/__snapshots__/PageSidebar.test.tsx.snap +1 -1
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +12 -12
- package/src/components/Progress/Progress.tsx +4 -0
- package/src/components/Progress/ProgressContainer.tsx +5 -2
- package/src/components/Progress/__tests__/Generated/ProgressContainer.test.tsx +1 -0
- package/src/components/Progress/__tests__/Progress.test.tsx +32 -0
- package/src/components/Progress/examples/Progress.md +2 -14
- package/src/components/Progress/examples/ProgressInteractiveFailure.tsx +55 -0
- package/src/components/Progress/examples/ProgressFailureWithoutMeasure.tsx +0 -5
- package/src/components/Progress/examples/ProgressInsideSuccess.tsx +0 -10
- package/src/components/Progress/examples/ProgressOutsideFailure.tsx +0 -10
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.5.0-prerelease.
|
|
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.5.0-prerelease.2","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.5.0-prerelease.
|
|
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.5.0-prerelease.2","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.5.0-prerelease.
|
|
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.5.0-prerelease.2","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.5.0-prerelease.
|
|
3
|
+
"version": "6.5.0-prerelease.3",
|
|
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",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@patternfly/react-icons": "^6.5.0-prerelease.
|
|
50
|
-
"@patternfly/react-styles": "^6.5.0-prerelease.
|
|
51
|
-
"@patternfly/react-tokens": "^6.5.0-prerelease.
|
|
49
|
+
"@patternfly/react-icons": "^6.5.0-prerelease.2",
|
|
50
|
+
"@patternfly/react-styles": "^6.5.0-prerelease.2",
|
|
51
|
+
"@patternfly/react-tokens": "^6.5.0-prerelease.2",
|
|
52
52
|
"focus-trap": "7.6.4",
|
|
53
53
|
"react-dropzone": "^14.3.5",
|
|
54
54
|
"tslib": "^2.8.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@patternfly/patternfly": "6.5.0-prerelease.
|
|
57
|
+
"@patternfly/patternfly": "6.5.0-prerelease.12",
|
|
58
58
|
"case-anything": "^3.1.2",
|
|
59
59
|
"css": "^3.0.0",
|
|
60
60
|
"fs-extra": "^11.3.0"
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"react": "^17 || ^18 || ^19",
|
|
64
64
|
"react-dom": "^17 || ^18 || ^19"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "40a5015cf1eb4730bda9c5c15e328f6d544bc857"
|
|
67
67
|
}
|
|
@@ -17,6 +17,8 @@ export interface DrawerProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
17
17
|
isExpanded?: boolean;
|
|
18
18
|
/** Indicates if the content element and panel element are displayed side by side. */
|
|
19
19
|
isInline?: boolean;
|
|
20
|
+
/** @beta Indicates if the drawer will have pill styles */
|
|
21
|
+
isPill?: boolean;
|
|
20
22
|
/** Indicates if the drawer will always show both content and panel. */
|
|
21
23
|
isStatic?: boolean;
|
|
22
24
|
/** Position of the drawer panel. left and right are deprecated, use start and end instead. */
|
|
@@ -50,6 +52,7 @@ export const Drawer: React.FunctionComponent<DrawerProps> = ({
|
|
|
50
52
|
children,
|
|
51
53
|
isExpanded = false,
|
|
52
54
|
isInline = false,
|
|
55
|
+
isPill = false,
|
|
53
56
|
isStatic = false,
|
|
54
57
|
position = 'end',
|
|
55
58
|
onExpand = () => {},
|
|
@@ -65,6 +68,7 @@ export const Drawer: React.FunctionComponent<DrawerProps> = ({
|
|
|
65
68
|
styles.drawer,
|
|
66
69
|
isExpanded && styles.modifiers.expanded,
|
|
67
70
|
isInline && styles.modifiers.inline,
|
|
71
|
+
isPill && styles.modifiers.pill,
|
|
68
72
|
isStatic && styles.modifiers.static,
|
|
69
73
|
(position === 'left' || position === 'start') && styles.modifiers.panelLeft,
|
|
70
74
|
position === 'bottom' && styles.modifiers.panelBottom,
|
|
@@ -10,9 +10,10 @@ import {
|
|
|
10
10
|
DrawerPanelContent,
|
|
11
11
|
DrawerColorVariant
|
|
12
12
|
} from '../';
|
|
13
|
-
import { render } from '@testing-library/react';
|
|
13
|
+
import { screen, render } from '@testing-library/react';
|
|
14
14
|
import userEvent from '@testing-library/user-event';
|
|
15
15
|
import { KeyTypes } from '../../../helpers';
|
|
16
|
+
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
16
17
|
|
|
17
18
|
jest.mock('../../../helpers/GenerateId/GenerateId');
|
|
18
19
|
|
|
@@ -162,3 +163,27 @@ test('Resizeable DrawerPanelContent can be wrapped in a context without causing
|
|
|
162
163
|
|
|
163
164
|
expect(consoleError).not.toHaveBeenCalled();
|
|
164
165
|
});
|
|
166
|
+
|
|
167
|
+
test(`Renders with ${styles.modifiers.pill} class when specified`, () => {
|
|
168
|
+
const panelContent = (
|
|
169
|
+
<DrawerPanelContent>
|
|
170
|
+
<DrawerHead>
|
|
171
|
+
<span>drawer-panel</span>
|
|
172
|
+
<DrawerActions>
|
|
173
|
+
<DrawerCloseButton />
|
|
174
|
+
</DrawerActions>
|
|
175
|
+
</DrawerHead>
|
|
176
|
+
<DrawerPanelBody>drawer-panel</DrawerPanelBody>
|
|
177
|
+
</DrawerPanelContent>
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
render(
|
|
181
|
+
<Drawer data-testid="drawer" isExpanded={true} position="left" isPill>
|
|
182
|
+
<DrawerContent panelContent={panelContent}>
|
|
183
|
+
<DrawerContentBody>Drawer content text</DrawerContentBody>
|
|
184
|
+
</DrawerContent>
|
|
185
|
+
</Drawer>
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
expect(screen.getByTestId('drawer')).toHaveClass(styles.modifiers.pill);
|
|
189
|
+
});
|
|
@@ -17,6 +17,7 @@ propComponents:
|
|
|
17
17
|
]
|
|
18
18
|
section: components
|
|
19
19
|
---
|
|
20
|
+
|
|
20
21
|
import { Fragment, useRef, useState } from 'react';
|
|
21
22
|
import accessibility from '@patternfly/react-styles/css/utilities/Accessibility/accessibility';
|
|
22
23
|
|
|
@@ -143,3 +144,15 @@ To customize which element receives focus when the drawer panel expands, use the
|
|
|
143
144
|
```ts file="./DrawerFocusTrap.tsx"
|
|
144
145
|
|
|
145
146
|
```
|
|
147
|
+
|
|
148
|
+
### Pill
|
|
149
|
+
|
|
150
|
+
```ts file="./DrawerBasicPill.tsx"
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Pill inline
|
|
155
|
+
|
|
156
|
+
```ts file="./DrawerPillInline.tsx"
|
|
157
|
+
|
|
158
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Fragment, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerBasicPill: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
15
|
+
const drawerRef = useRef<HTMLDivElement>(undefined);
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
Drawer panel header
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} isPill onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
|
+
</DrawerContent>
|
|
54
|
+
</Drawer>
|
|
55
|
+
</Fragment>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Fragment, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerBasicPill: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
15
|
+
const drawerRef = useRef<HTMLDivElement>(undefined);
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
Drawer panel header
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} isPill isInline onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
|
+
</DrawerContent>
|
|
54
|
+
</Drawer>
|
|
55
|
+
</Fragment>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -44,8 +44,10 @@ export interface ExpandableSectionProps extends Omit<React.HTMLProps<HTMLDivElem
|
|
|
44
44
|
* use the onToggle property of the expandable section toggle sub-component.
|
|
45
45
|
*/
|
|
46
46
|
onToggle?: (event: React.MouseEvent, isExpanded: boolean) => void;
|
|
47
|
-
/** React node that appears in the attached toggle in place of the toggleText property.
|
|
48
|
-
|
|
47
|
+
/** React node that appears in the attached toggle in place of the toggleText property.
|
|
48
|
+
* Can also be a function that receives the expanded state and returns a React node.
|
|
49
|
+
*/
|
|
50
|
+
toggleContent?: React.ReactNode | ((isExpanded: boolean) => React.ReactNode);
|
|
49
51
|
/** Text that appears in the attached toggle. */
|
|
50
52
|
toggleText?: string;
|
|
51
53
|
/** Text that appears in the attached toggle when collapsed (will override toggleText if
|
|
@@ -246,6 +248,9 @@ class ExpandableSection extends Component<ExpandableSectionProps, ExpandableSect
|
|
|
246
248
|
propOrStateIsExpanded
|
|
247
249
|
);
|
|
248
250
|
|
|
251
|
+
const computedToggleContent =
|
|
252
|
+
typeof toggleContent === 'function' ? toggleContent(propOrStateIsExpanded) : toggleContent;
|
|
253
|
+
|
|
249
254
|
const expandableToggle = !isDetached && (
|
|
250
255
|
<div className={`${styles.expandableSection}__toggle`}>
|
|
251
256
|
<Button
|
|
@@ -265,7 +270,7 @@ class ExpandableSection extends Component<ExpandableSectionProps, ExpandableSect
|
|
|
265
270
|
aria-label={toggleAriaLabel}
|
|
266
271
|
aria-labelledby={toggleAriaLabelledBy}
|
|
267
272
|
>
|
|
268
|
-
{
|
|
273
|
+
{computedToggleContent || computedToggleText}
|
|
269
274
|
</Button>
|
|
270
275
|
</div>
|
|
271
276
|
);
|
|
@@ -208,3 +208,37 @@ test('Renders with aria-labelledby when toggleAriaLabelledBy is passed', () => {
|
|
|
208
208
|
|
|
209
209
|
expect(screen.getByRole('button')).toHaveAccessibleName('Test label');
|
|
210
210
|
});
|
|
211
|
+
test('Renders toggleContent as a function in uncontrolled mode (collapsed)', () => {
|
|
212
|
+
render(
|
|
213
|
+
<ExpandableSection toggleContent={(isExpanded) => (isExpanded ? 'Hide details' : 'Show details')}>
|
|
214
|
+
Test content
|
|
215
|
+
</ExpandableSection>
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
expect(screen.getByRole('button', { name: 'Show details' })).toBeInTheDocument();
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
test('Renders toggleContent as a function in uncontrolled mode (expanded after click)', async () => {
|
|
222
|
+
const user = userEvent.setup();
|
|
223
|
+
|
|
224
|
+
render(
|
|
225
|
+
<ExpandableSection toggleContent={(isExpanded) => (isExpanded ? 'Hide details' : 'Show details')}>
|
|
226
|
+
Test content
|
|
227
|
+
</ExpandableSection>
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
const button = screen.getByRole('button', { name: 'Show details' });
|
|
231
|
+
await user.click(button);
|
|
232
|
+
|
|
233
|
+
expect(screen.getByRole('button', { name: 'Hide details' })).toBeInTheDocument();
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
test('Renders toggleContent as a function in controlled mode', () => {
|
|
237
|
+
render(
|
|
238
|
+
<ExpandableSection isExpanded={true} toggleContent={(isExpanded) => (isExpanded ? 'Collapse' : 'Expand')}>
|
|
239
|
+
Test content
|
|
240
|
+
</ExpandableSection>
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
expect(screen.getByRole('button', { name: 'Collapse' })).toBeInTheDocument();
|
|
244
|
+
});
|
|
@@ -28,6 +28,14 @@ import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle
|
|
|
28
28
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
### Uncontrolled with dynamic toggle content (function)
|
|
32
|
+
|
|
33
|
+
Use `toggleContent` as a function to dynamically render different content based on the expanded state without managing state yourself.
|
|
34
|
+
|
|
35
|
+
```ts file="ExpandableSectionUncontrolledDynamicToggleFunction.tsx"
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
|
|
31
39
|
### Detached
|
|
32
40
|
|
|
33
41
|
When passing the `isDetached` property into `<ExpandableSection>`, you must also manually pass in the same `toggleId` and `contentId` properties to both `<ExpandableSection>` and `<ExpandableSectionToggle>`. This will link the content to the toggle via ARIA attributes.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExpandableSection } from '@patternfly/react-core';
|
|
2
|
+
|
|
3
|
+
export const ExpandableSectionUncontrolledDynamicToggleFunction: React.FunctionComponent = () => (
|
|
4
|
+
<ExpandableSection
|
|
5
|
+
toggleContent={(isExpanded) =>
|
|
6
|
+
isExpanded
|
|
7
|
+
? 'Show less uncontrolled dynamic toggle example content'
|
|
8
|
+
: 'Show more uncontrolled dynamic toggle example content'
|
|
9
|
+
}
|
|
10
|
+
>
|
|
11
|
+
This content is visible only when the component is expanded.
|
|
12
|
+
</ExpandableSection>
|
|
13
|
+
);
|
|
@@ -266,6 +266,7 @@ class Page extends Component<PageProps, PageState> {
|
|
|
266
266
|
isManagedSidebar,
|
|
267
267
|
onSidebarToggle: mobileView ? this.onSidebarToggleMobile : this.onSidebarToggleDesktop,
|
|
268
268
|
isSidebarOpen: mobileView ? mobileIsSidebarOpen : desktopIsSidebarOpen,
|
|
269
|
+
isMobile: mobileView,
|
|
269
270
|
width,
|
|
270
271
|
height,
|
|
271
272
|
getBreakpoint,
|
|
@@ -6,6 +6,7 @@ export interface PageContextProps {
|
|
|
6
6
|
isManagedSidebar: boolean;
|
|
7
7
|
onSidebarToggle: () => void;
|
|
8
8
|
isSidebarOpen: boolean;
|
|
9
|
+
isMobile: boolean;
|
|
9
10
|
width: number;
|
|
10
11
|
height: number;
|
|
11
12
|
getBreakpoint: (width: number | null) => 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
@@ -16,6 +17,7 @@ export const pageContextDefaults: PageContextProps = {
|
|
|
16
17
|
isManagedSidebar: false,
|
|
17
18
|
isSidebarOpen: false,
|
|
18
19
|
onSidebarToggle: () => null,
|
|
20
|
+
isMobile: false,
|
|
19
21
|
width: null,
|
|
20
22
|
height: null,
|
|
21
23
|
getBreakpoint,
|
|
@@ -35,7 +35,7 @@ export const PageSidebar: React.FunctionComponent<PageSidebarProps> = ({
|
|
|
35
35
|
...props
|
|
36
36
|
}: PageSidebarProps) => (
|
|
37
37
|
<PageContextConsumer>
|
|
38
|
-
{({ isManagedSidebar, isSidebarOpen: managedIsNavOpen }
|
|
38
|
+
{({ isManagedSidebar, isSidebarOpen: managedIsNavOpen, isMobile }) => {
|
|
39
39
|
const sidebarOpen = isManagedSidebar ? managedIsNavOpen : isSidebarOpen;
|
|
40
40
|
|
|
41
41
|
return (
|
|
@@ -43,7 +43,7 @@ export const PageSidebar: React.FunctionComponent<PageSidebarProps> = ({
|
|
|
43
43
|
id={id}
|
|
44
44
|
className={css(
|
|
45
45
|
styles.pageSidebar,
|
|
46
|
-
sidebarOpen && styles.modifiers.expanded,
|
|
46
|
+
sidebarOpen && isMobile && styles.modifiers.expanded,
|
|
47
47
|
!sidebarOpen && styles.modifiers.collapsed,
|
|
48
48
|
className
|
|
49
49
|
)}
|
|
@@ -12,7 +12,7 @@ exports[`Page Check dark page against snapshot 1`] = `
|
|
|
12
12
|
/>
|
|
13
13
|
<div
|
|
14
14
|
aria-hidden="false"
|
|
15
|
-
class="pf-v6-c-page__sidebar
|
|
15
|
+
class="pf-v6-c-page__sidebar"
|
|
16
16
|
id="page-sidebar"
|
|
17
17
|
>
|
|
18
18
|
<div
|
|
@@ -55,7 +55,7 @@ exports[`Page Check page horizontal layout example against snapshot 1`] = `
|
|
|
55
55
|
/>
|
|
56
56
|
<div
|
|
57
57
|
aria-hidden="false"
|
|
58
|
-
class="pf-v6-c-page__sidebar
|
|
58
|
+
class="pf-v6-c-page__sidebar"
|
|
59
59
|
id="page-sidebar"
|
|
60
60
|
/>
|
|
61
61
|
<div
|
|
@@ -92,7 +92,7 @@ exports[`Page Check page to verify breadcrumb is created - PageBreadcrumb syntax
|
|
|
92
92
|
/>
|
|
93
93
|
<div
|
|
94
94
|
aria-hidden="false"
|
|
95
|
-
class="pf-v6-c-page__sidebar
|
|
95
|
+
class="pf-v6-c-page__sidebar"
|
|
96
96
|
id="page-sidebar"
|
|
97
97
|
/>
|
|
98
98
|
<div
|
|
@@ -237,7 +237,7 @@ exports[`Page Check page to verify breadcrumb is created 1`] = `
|
|
|
237
237
|
/>
|
|
238
238
|
<div
|
|
239
239
|
aria-hidden="false"
|
|
240
|
-
class="pf-v6-c-page__sidebar
|
|
240
|
+
class="pf-v6-c-page__sidebar"
|
|
241
241
|
id="page-sidebar"
|
|
242
242
|
/>
|
|
243
243
|
<div
|
|
@@ -386,7 +386,7 @@ exports[`Page Check page to verify grouped nav and breadcrumb - new components s
|
|
|
386
386
|
/>
|
|
387
387
|
<div
|
|
388
388
|
aria-hidden="false"
|
|
389
|
-
class="pf-v6-c-page__sidebar
|
|
389
|
+
class="pf-v6-c-page__sidebar"
|
|
390
390
|
id="page-sidebar"
|
|
391
391
|
/>
|
|
392
392
|
<div
|
|
@@ -629,7 +629,7 @@ exports[`Page Check page to verify grouped nav and breadcrumb - old / props synt
|
|
|
629
629
|
/>
|
|
630
630
|
<div
|
|
631
631
|
aria-hidden="false"
|
|
632
|
-
class="pf-v6-c-page__sidebar
|
|
632
|
+
class="pf-v6-c-page__sidebar"
|
|
633
633
|
id="page-sidebar"
|
|
634
634
|
/>
|
|
635
635
|
<div
|
|
@@ -913,7 +913,7 @@ exports[`Page Check page to verify skip to content points to main content region
|
|
|
913
913
|
/>
|
|
914
914
|
<div
|
|
915
915
|
aria-hidden="false"
|
|
916
|
-
class="pf-v6-c-page__sidebar
|
|
916
|
+
class="pf-v6-c-page__sidebar"
|
|
917
917
|
id="page-sidebar"
|
|
918
918
|
/>
|
|
919
919
|
<div
|
|
@@ -1063,7 +1063,7 @@ exports[`Page Check page vertical layout example against snapshot 1`] = `
|
|
|
1063
1063
|
/>
|
|
1064
1064
|
<div
|
|
1065
1065
|
aria-hidden="false"
|
|
1066
|
-
class="pf-v6-c-page__sidebar
|
|
1066
|
+
class="pf-v6-c-page__sidebar"
|
|
1067
1067
|
id="page-sidebar"
|
|
1068
1068
|
>
|
|
1069
1069
|
<div
|
|
@@ -1106,7 +1106,7 @@ exports[`Page Sticky bottom breadcrumb on all height breakpoints - PageBreadcrum
|
|
|
1106
1106
|
/>
|
|
1107
1107
|
<div
|
|
1108
1108
|
aria-hidden="false"
|
|
1109
|
-
class="pf-v6-c-page__sidebar
|
|
1109
|
+
class="pf-v6-c-page__sidebar"
|
|
1110
1110
|
id="page-sidebar"
|
|
1111
1111
|
/>
|
|
1112
1112
|
<div
|
|
@@ -1251,7 +1251,7 @@ exports[`Page Verify sticky bottom breadcrumb on all height breakpoints 1`] = `
|
|
|
1251
1251
|
/>
|
|
1252
1252
|
<div
|
|
1253
1253
|
aria-hidden="false"
|
|
1254
|
-
class="pf-v6-c-page__sidebar
|
|
1254
|
+
class="pf-v6-c-page__sidebar"
|
|
1255
1255
|
id="page-sidebar"
|
|
1256
1256
|
/>
|
|
1257
1257
|
<div
|
|
@@ -1400,7 +1400,7 @@ exports[`Page Verify sticky top breadcrumb on all height breakpoints - PageBread
|
|
|
1400
1400
|
/>
|
|
1401
1401
|
<div
|
|
1402
1402
|
aria-hidden="false"
|
|
1403
|
-
class="pf-v6-c-page__sidebar
|
|
1403
|
+
class="pf-v6-c-page__sidebar"
|
|
1404
1404
|
id="page-sidebar"
|
|
1405
1405
|
/>
|
|
1406
1406
|
<div
|
|
@@ -1545,7 +1545,7 @@ exports[`Page Verify sticky top breadcrumb on all height breakpoints 1`] = `
|
|
|
1545
1545
|
/>
|
|
1546
1546
|
<div
|
|
1547
1547
|
aria-hidden="false"
|
|
1548
|
-
class="pf-v6-c-page__sidebar
|
|
1548
|
+
class="pf-v6-c-page__sidebar"
|
|
1549
1549
|
id="page-sidebar"
|
|
1550
1550
|
/>
|
|
1551
1551
|
<div
|
|
@@ -48,6 +48,8 @@ export interface ProgressProps extends Omit<React.HTMLProps<HTMLDivElement>, 'si
|
|
|
48
48
|
* We recommend the helper text component as it was designed for this purpose.
|
|
49
49
|
*/
|
|
50
50
|
helperText?: React.ReactNode;
|
|
51
|
+
/** Flag indicating whether the status icon should be hidden, helpful when space is limited (such as within table cells). When set to true, you must ensure the context of the status is provided in another way, such as via the progress measure. */
|
|
52
|
+
hideStatusIcon?: boolean;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
class Progress extends Component<ProgressProps> {
|
|
@@ -94,6 +96,7 @@ class Progress extends Component<ProgressProps> {
|
|
|
94
96
|
'aria-labelledby': ariaLabelledBy,
|
|
95
97
|
'aria-describedby': ariaDescribedBy,
|
|
96
98
|
helperText,
|
|
99
|
+
hideStatusIcon,
|
|
97
100
|
...props
|
|
98
101
|
} = this.props;
|
|
99
102
|
|
|
@@ -151,6 +154,7 @@ class Progress extends Component<ProgressProps> {
|
|
|
151
154
|
isTitleTruncated={isTitleTruncated}
|
|
152
155
|
tooltipPosition={tooltipPosition}
|
|
153
156
|
helperText={helperText}
|
|
157
|
+
hideStatusIcon={hideStatusIcon}
|
|
154
158
|
/>
|
|
155
159
|
</div>
|
|
156
160
|
);
|
|
@@ -58,6 +58,8 @@ export interface ProgressContainerProps extends Omit<React.HTMLProps<HTMLDivElem
|
|
|
58
58
|
* We recommend the helper text component as it was designed for this purpose.
|
|
59
59
|
*/
|
|
60
60
|
helperText?: React.ReactNode;
|
|
61
|
+
/** Hide the status icon, helpful when space is limited (such as within table cells) */
|
|
62
|
+
hideStatusIcon?: boolean;
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
const variantToIcon = {
|
|
@@ -76,9 +78,10 @@ export const ProgressContainer: React.FunctionComponent<ProgressContainerProps>
|
|
|
76
78
|
measureLocation = ProgressMeasureLocation.top,
|
|
77
79
|
isTitleTruncated = false,
|
|
78
80
|
tooltipPosition,
|
|
79
|
-
helperText
|
|
81
|
+
helperText,
|
|
82
|
+
hideStatusIcon = false
|
|
80
83
|
}: ProgressContainerProps) => {
|
|
81
|
-
const StatusIcon = variantToIcon.hasOwnProperty(variant) && variantToIcon[variant];
|
|
84
|
+
const StatusIcon = !hideStatusIcon && variantToIcon.hasOwnProperty(variant) && variantToIcon[variant];
|
|
82
85
|
const [tooltip, setTooltip] = useState('');
|
|
83
86
|
const titleRef = useRef(null);
|
|
84
87
|
const updateTooltip = (event: any) => {
|
|
@@ -108,3 +108,35 @@ test('Renders passed helper text', () => {
|
|
|
108
108
|
|
|
109
109
|
expect(screen.getByText('Test helper text')).toBeVisible();
|
|
110
110
|
});
|
|
111
|
+
|
|
112
|
+
describe('hideStatusIcon prop behavior', () => {
|
|
113
|
+
test('shows status icon by default when hideStatusIcon is not set', () => {
|
|
114
|
+
render(<Progress id="default-status-icon-test" value={100} variant="success" />);
|
|
115
|
+
|
|
116
|
+
expect(screen.getByRole('img', { hidden: true })).toBeInTheDocument();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test('hides status icon when hideStatusIcon flag is set with success variant', () => {
|
|
120
|
+
render(<Progress id="hide-icon-success" value={100} variant="success" hideStatusIcon />);
|
|
121
|
+
|
|
122
|
+
expect(screen.queryByRole('img', { hidden: true })).not.toBeInTheDocument();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('hides status icon when hideStatusIcon flag is set with danger variant', () => {
|
|
126
|
+
render(<Progress id="hide-icon-danger" value={50} variant="danger" hideStatusIcon />);
|
|
127
|
+
|
|
128
|
+
expect(screen.queryByRole('img', { hidden: true })).not.toBeInTheDocument();
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
test('hides status icon when hideStatusIcon flag is set with warning variant', () => {
|
|
132
|
+
render(<Progress id="hide-icon-warning" value={75} variant="warning" hideStatusIcon />);
|
|
133
|
+
|
|
134
|
+
expect(screen.queryByRole('img', { hidden: true })).not.toBeInTheDocument();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test('shows status icon when hideStatusIcon is explicitly false', () => {
|
|
138
|
+
render(<Progress id="show-icon-success" value={100} variant="success" hideStatusIcon={false} />);
|
|
139
|
+
|
|
140
|
+
expect(screen.getByRole('img', { hidden: true })).toBeInTheDocument();
|
|
141
|
+
});
|
|
142
|
+
});
|
|
@@ -107,20 +107,8 @@ When conveying status, you should ensure:
|
|
|
107
107
|
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
###
|
|
110
|
+
### Interactive status icon and measure location
|
|
111
111
|
|
|
112
|
-
```ts file="./
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Outside failure
|
|
117
|
-
|
|
118
|
-
```ts file="./ProgressOutsideFailure.tsx"
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Failure without measure
|
|
123
|
-
|
|
124
|
-
```ts file="./ProgressFailureWithoutMeasure.tsx"
|
|
112
|
+
```ts file="./ProgressInteractiveFailure.tsx"
|
|
125
113
|
|
|
126
114
|
```
|