@patternfly/react-core 6.3.1-prerelease.7 → 6.3.1-prerelease.9
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 +10 -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/ClipboardCopy/ClipboardCopy.d.ts +2 -0
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +3 -3
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.d.ts +2 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js +2 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.d.ts +0 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js +2 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.js +1 -1
- package/dist/esm/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/esm/deprecated/components/Wizard/WizardNavItem.js +1 -1
- package/dist/esm/deprecated/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +2 -0
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +3 -3
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.d.ts +2 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js +2 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.d.ts +0 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js +2 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopyToggle.js.map +1 -1
- package/dist/js/components/Wizard/WizardNavItem.js +1 -1
- package/dist/js/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/deprecated/components/Wizard/WizardNavItem.js +1 -1
- package/dist/js/deprecated/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/styles/base-no-reset.css +1209 -1
- package/dist/styles/base.css +1213 -1
- package/dist/umd/assets/{output-CJCeYpx2.css → output-D8x_lwPB.css} +20538 -20250
- 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 +6 -6
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +5 -5
- package/src/components/ClipboardCopy/ClipboardCopyButton.tsx +2 -4
- package/src/components/ClipboardCopy/ClipboardCopyToggle.tsx +0 -3
- package/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx +16 -0
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyButton.test.tsx +5 -28
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyToggle.test.tsx +3 -4
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopy.test.tsx.snap +1 -1
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyButton.test.tsx.snap +0 -1
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap +0 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyBasic.tsx +1 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyExpanded.tsx +7 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyExpandedWithArray.tsx +7 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompact.tsx +1 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompactCode.tsx +7 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompactInSentence.tsx +19 -3
- package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompactTruncation.tsx +14 -2
- package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompactWithAdditionalAction.tsx +1 -0
- package/src/components/ClipboardCopy/examples/ClipboardCopyJSONObject.tsx +8 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyReadOnly.tsx +1 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyReadOnlyExpanded.tsx +8 -1
- package/src/components/ClipboardCopy/examples/ClipboardCopyReadOnlyExpandedByDefault.tsx +9 -1
- package/src/components/Wizard/WizardNavItem.tsx +1 -1
- package/src/deprecated/components/Wizard/WizardNavItem.tsx +1 -1
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-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.3.1-prerelease.8","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-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.3.1-prerelease.8","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-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.3.1-prerelease.8","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.9",
|
|
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.3.0",
|
|
50
|
-
"@patternfly/react-styles": "^6.3.0",
|
|
51
|
-
"@patternfly/react-tokens": "^6.3.0",
|
|
49
|
+
"@patternfly/react-icons": "^6.3.1-prerelease.0",
|
|
50
|
+
"@patternfly/react-styles": "^6.3.1-prerelease.0",
|
|
51
|
+
"@patternfly/react-tokens": "^6.3.1-prerelease.0",
|
|
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.3.0-prerelease.
|
|
57
|
+
"@patternfly/patternfly": "6.3.0-prerelease.55",
|
|
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": "8e9e603510bbf600cce2c18ca4bd45805c78a4f9"
|
|
67
67
|
}
|
|
@@ -49,6 +49,8 @@ export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>
|
|
|
49
49
|
hoverTip?: string;
|
|
50
50
|
/** Tooltip message to display when clicking the copy button */
|
|
51
51
|
clickTip?: string;
|
|
52
|
+
/** Aria-label to use on the copy button */
|
|
53
|
+
copyAriaLabel?: string;
|
|
52
54
|
/** Aria-label to use on the TextInput. */
|
|
53
55
|
textAriaLabel?: string;
|
|
54
56
|
/** Aria-label to use on the ClipboardCopyToggle. */
|
|
@@ -194,6 +196,7 @@ class ClipboardCopy extends Component<ClipboardCopyProps, ClipboardCopyState> {
|
|
|
194
196
|
truncation,
|
|
195
197
|
ouiaId,
|
|
196
198
|
ouiaSafe,
|
|
199
|
+
copyAriaLabel,
|
|
197
200
|
...divProps
|
|
198
201
|
} = this.props;
|
|
199
202
|
const textIdPrefix = 'text-input-';
|
|
@@ -250,8 +253,7 @@ class ClipboardCopy extends Component<ClipboardCopyProps, ClipboardCopyState> {
|
|
|
250
253
|
maxWidth={maxWidth}
|
|
251
254
|
position={position}
|
|
252
255
|
id={`copy-button-${id}`}
|
|
253
|
-
|
|
254
|
-
aria-label={hoverTip}
|
|
256
|
+
aria-label={copyAriaLabel ?? hoverTip}
|
|
255
257
|
onClick={(event: any) => {
|
|
256
258
|
onCopy(event, copyableText);
|
|
257
259
|
this.setState({ copied: true });
|
|
@@ -285,7 +287,6 @@ class ClipboardCopy extends Component<ClipboardCopyProps, ClipboardCopyState> {
|
|
|
285
287
|
}
|
|
286
288
|
}}
|
|
287
289
|
id={`${toggleIdPrefix}${id}`}
|
|
288
|
-
textId={`${textIdPrefix}${id}`}
|
|
289
290
|
contentId={`${contentIdPrefix}${id}`}
|
|
290
291
|
aria-label={toggleAriaLabel}
|
|
291
292
|
/>
|
|
@@ -304,8 +305,7 @@ class ClipboardCopy extends Component<ClipboardCopyProps, ClipboardCopyState> {
|
|
|
304
305
|
maxWidth={maxWidth}
|
|
305
306
|
position={position}
|
|
306
307
|
id={`copy-button-${id}`}
|
|
307
|
-
|
|
308
|
-
aria-label={hoverTip}
|
|
308
|
+
aria-label={copyAriaLabel ?? hoverTip}
|
|
309
309
|
onClick={(event: any) => {
|
|
310
310
|
onCopy(event, this.state.expanded ? this.state.textWhenExpanded : copyableText);
|
|
311
311
|
this.setState({ copied: true });
|
|
@@ -11,8 +11,8 @@ export interface ClipboardCopyButtonProps
|
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
/** ID of the copy button */
|
|
13
13
|
id: string;
|
|
14
|
-
/** ID of the content that is being copied */
|
|
15
|
-
textId
|
|
14
|
+
/** @deprecated ID of the content that is being copied */
|
|
15
|
+
textId?: string;
|
|
16
16
|
/** Additional classes added to the copy button */
|
|
17
17
|
className?: string;
|
|
18
18
|
/** Exit delay on the copy button tooltip */
|
|
@@ -55,7 +55,6 @@ export const ClipboardCopyButton: React.FunctionComponent<ClipboardCopyButtonPro
|
|
|
55
55
|
position = 'top',
|
|
56
56
|
'aria-label': ariaLabel = 'Copyable input',
|
|
57
57
|
id,
|
|
58
|
-
textId,
|
|
59
58
|
children,
|
|
60
59
|
variant = 'control',
|
|
61
60
|
onTooltipHidden = () => {},
|
|
@@ -86,7 +85,6 @@ export const ClipboardCopyButton: React.FunctionComponent<ClipboardCopyButtonPro
|
|
|
86
85
|
aria-label={ariaLabel}
|
|
87
86
|
className={className}
|
|
88
87
|
id={id}
|
|
89
|
-
aria-labelledby={`${id} ${textId}`}
|
|
90
88
|
icon={<CopyIcon />}
|
|
91
89
|
{...props}
|
|
92
90
|
ref={triggerRef}
|
|
@@ -7,7 +7,6 @@ export interface ClipboardCopyToggleProps
|
|
|
7
7
|
extends Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, 'ref'> {
|
|
8
8
|
onClick: (event: React.MouseEvent) => void;
|
|
9
9
|
id: string;
|
|
10
|
-
textId: string;
|
|
11
10
|
contentId: string;
|
|
12
11
|
isExpanded?: boolean;
|
|
13
12
|
className?: string;
|
|
@@ -16,7 +15,6 @@ export interface ClipboardCopyToggleProps
|
|
|
16
15
|
export const ClipboardCopyToggle: React.FunctionComponent<ClipboardCopyToggleProps> = ({
|
|
17
16
|
onClick,
|
|
18
17
|
id,
|
|
19
|
-
textId,
|
|
20
18
|
contentId,
|
|
21
19
|
isExpanded = false,
|
|
22
20
|
...props
|
|
@@ -26,7 +24,6 @@ export const ClipboardCopyToggle: React.FunctionComponent<ClipboardCopyTogglePro
|
|
|
26
24
|
variant="control"
|
|
27
25
|
onClick={onClick}
|
|
28
26
|
id={id}
|
|
29
|
-
aria-labelledby={`${id} ${textId}`}
|
|
30
27
|
aria-controls={isExpanded ? contentId : undefined}
|
|
31
28
|
aria-expanded={isExpanded}
|
|
32
29
|
{...props}
|
|
@@ -265,6 +265,22 @@ test('Passes position to ClipboardCopyButton when variant is inline-compact', ()
|
|
|
265
265
|
expect(screen.getByText('position: bottom')).toBeVisible();
|
|
266
266
|
});
|
|
267
267
|
|
|
268
|
+
test('Passes copyAriaLabel to ClipboardCopyButton', () => {
|
|
269
|
+
render(<ClipboardCopy copyAriaLabel="Copy text">{children}</ClipboardCopy>);
|
|
270
|
+
|
|
271
|
+
expect(screen.getByText('button-ariaLabel: Copy text')).toBeVisible();
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
test('Passes copyAriaLabel over hoverTip to ClipboardCopyButton when both are provided', () => {
|
|
275
|
+
render(
|
|
276
|
+
<ClipboardCopy copyAriaLabel="Copy text" hoverTip="Hover tip">
|
|
277
|
+
{children}
|
|
278
|
+
</ClipboardCopy>
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
expect(screen.getByText('button-ariaLabel: Copy text')).toBeVisible();
|
|
282
|
+
});
|
|
283
|
+
|
|
268
284
|
test('Passes toggleAriaLabel to ClipboardCopyToggle when variant is expansion', () => {
|
|
269
285
|
render(
|
|
270
286
|
<ClipboardCopy variant="expansion" toggleAriaLabel="toggle label">
|
|
@@ -21,8 +21,7 @@ jest.mock('../../Tooltip', () => ({
|
|
|
21
21
|
const requiredProps = {
|
|
22
22
|
onClick: jest.fn(),
|
|
23
23
|
children: 'Button content',
|
|
24
|
-
id: 'button-id'
|
|
25
|
-
textId: 'text-id'
|
|
24
|
+
id: 'button-id'
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
// Must be kept as first test to avoid Button's ouiaId updating in snapshots
|
|
@@ -37,37 +36,15 @@ test('Renders with passed id prop', () => {
|
|
|
37
36
|
expect(screen.getByRole('button')).toHaveAttribute('id', 'button-id');
|
|
38
37
|
});
|
|
39
38
|
|
|
40
|
-
test('Renders with aria-
|
|
39
|
+
test('Renders with aria-label', () => {
|
|
41
40
|
render(
|
|
42
41
|
<>
|
|
43
|
-
<div
|
|
44
|
-
<ClipboardCopyButton {...requiredProps} />
|
|
45
|
-
</>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
expect(screen.getByRole('button')).toHaveAccessibleName('Copyable input Copyable text');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('Renders with concatenated aria-label by default', () => {
|
|
52
|
-
render(
|
|
53
|
-
<>
|
|
54
|
-
<div id="text-id">Copyable text</div>
|
|
55
|
-
<ClipboardCopyButton {...requiredProps} />
|
|
56
|
-
</>
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
expect(screen.getByRole('button')).toHaveAccessibleName('Copyable input Copyable text');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test('Renders with concatenated aria-label when custom aria-label is passed', () => {
|
|
63
|
-
render(
|
|
64
|
-
<>
|
|
65
|
-
<div id="text-id">Copyable text</div>
|
|
66
|
-
<ClipboardCopyButton aria-label="Custom label" {...requiredProps} />
|
|
42
|
+
<div>Copyable text</div>
|
|
43
|
+
<ClipboardCopyButton aria-label="Copy" {...requiredProps} />
|
|
67
44
|
</>
|
|
68
45
|
);
|
|
69
46
|
|
|
70
|
-
expect(screen.getByRole('button')).toHaveAccessibleName('
|
|
47
|
+
expect(screen.getByRole('button')).toHaveAccessibleName('Copy');
|
|
71
48
|
});
|
|
72
49
|
|
|
73
50
|
test('Passes className to Button', () => {
|
|
@@ -5,7 +5,6 @@ import userEvent from '@testing-library/user-event';
|
|
|
5
5
|
const onClickMock = jest.fn();
|
|
6
6
|
const requiredProps = {
|
|
7
7
|
id: 'main-id',
|
|
8
|
-
textId: 'text-id',
|
|
9
8
|
contentId: 'content-id',
|
|
10
9
|
onClick: onClickMock
|
|
11
10
|
};
|
|
@@ -33,15 +32,15 @@ test('Renders with id prop', () => {
|
|
|
33
32
|
expect(screen.getByRole('button')).toHaveAttribute('id', requiredProps.id);
|
|
34
33
|
});
|
|
35
34
|
|
|
36
|
-
test('Renders with aria-
|
|
35
|
+
test('Renders with aria-label', () => {
|
|
37
36
|
render(
|
|
38
37
|
<>
|
|
39
38
|
<ClipboardCopyToggle aria-label="Toggle content" {...requiredProps} />
|
|
40
|
-
<span
|
|
39
|
+
<span>Test content</span>
|
|
41
40
|
</>
|
|
42
41
|
);
|
|
43
42
|
|
|
44
|
-
expect(screen.getByRole('button')).toHaveAccessibleName('Toggle content
|
|
43
|
+
expect(screen.getByRole('button')).toHaveAccessibleName('Toggle content');
|
|
45
44
|
});
|
|
46
45
|
|
|
47
46
|
test('Does not render with aria-controls when isExpanded is false', () => {
|
|
@@ -18,7 +18,7 @@ exports[`Matches snapshot 1`] = `
|
|
|
18
18
|
<input
|
|
19
19
|
aria-invalid="false"
|
|
20
20
|
aria-label="Copyable input"
|
|
21
|
-
data-ouia-component-id="OUIA-Generated-TextInputBase-
|
|
21
|
+
data-ouia-component-id="OUIA-Generated-TextInputBase-36"
|
|
22
22
|
data-ouia-component-type="PF6/TextInput"
|
|
23
23
|
data-ouia-safe="true"
|
|
24
24
|
id="text-input-generated-id"
|
package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyButton.test.tsx.snap
CHANGED
|
@@ -29,7 +29,6 @@ exports[`Matches snapshot 1`] = `
|
|
|
29
29
|
</a>
|
|
30
30
|
<button
|
|
31
31
|
aria-label="Copyable input"
|
|
32
|
-
aria-labelledby="button-id text-id"
|
|
33
32
|
class="pf-v6-c-button pf-m-control"
|
|
34
33
|
data-ouia-component-id="OUIA-Generated-Button-control-1"
|
|
35
34
|
data-ouia-component-type="PF6/Button"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClipboardCopy } from '@patternfly/react-core';
|
|
2
2
|
|
|
3
3
|
export const ClipboardCopyBasic: React.FunctionComponent = () => (
|
|
4
|
-
<ClipboardCopy hoverTip="Copy" clickTip="Copied">
|
|
4
|
+
<ClipboardCopy copyAriaLabel="Copy basic example" hoverTip="Copy" clickTip="Copied">
|
|
5
5
|
This is editable
|
|
6
6
|
</ClipboardCopy>
|
|
7
7
|
);
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
|
|
2
2
|
|
|
3
3
|
export const ClipboardCopyExpanded: React.FunctionComponent = () => (
|
|
4
|
-
<ClipboardCopy
|
|
4
|
+
<ClipboardCopy
|
|
5
|
+
toggleAriaLabel="Show content for expanded example"
|
|
6
|
+
copyAriaLabel="Copy expanded example"
|
|
7
|
+
hoverTip="Copy"
|
|
8
|
+
clickTip="Copied"
|
|
9
|
+
variant={ClipboardCopyVariant.expansion}
|
|
10
|
+
>
|
|
5
11
|
Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
|
|
6
12
|
expansion.
|
|
7
13
|
</ClipboardCopy>
|
|
@@ -7,7 +7,13 @@ const text = [
|
|
|
7
7
|
];
|
|
8
8
|
|
|
9
9
|
export const ClipboardCopyExpandedWithArray: React.FunctionComponent = () => (
|
|
10
|
-
<ClipboardCopy
|
|
10
|
+
<ClipboardCopy
|
|
11
|
+
copyAriaLabel="Copy expanded example with array"
|
|
12
|
+
toggleAriaLabel="Show content for expanded example with array"
|
|
13
|
+
hoverTip="Copy"
|
|
14
|
+
clickTip="Copied"
|
|
15
|
+
variant={ClipboardCopyVariant.expansion}
|
|
16
|
+
>
|
|
11
17
|
{text.join(' ')}
|
|
12
18
|
</ClipboardCopy>
|
|
13
19
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClipboardCopy } from '@patternfly/react-core';
|
|
2
2
|
export const ClipboardCopyInlineCompact: React.FunctionComponent = () => (
|
|
3
|
-
<ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact">
|
|
3
|
+
<ClipboardCopy copyAriaLabel="Copy inline compact example" hoverTip="Copy" clickTip="Copied" variant="inline-compact">
|
|
4
4
|
2.3.4-2-redhat
|
|
5
5
|
</ClipboardCopy>
|
|
6
6
|
);
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ClipboardCopy } from '@patternfly/react-core';
|
|
2
2
|
|
|
3
3
|
export const ClipboardCopyInlineCompactCode: React.FunctionComponent = () => (
|
|
4
|
-
<ClipboardCopy
|
|
4
|
+
<ClipboardCopy
|
|
5
|
+
copyAriaLabel="Copy inline compact code example"
|
|
6
|
+
hoverTip="Copy"
|
|
7
|
+
clickTip="Copied"
|
|
8
|
+
variant="inline-compact"
|
|
9
|
+
isCode
|
|
10
|
+
>
|
|
5
11
|
2.3.4-2-redhat
|
|
6
12
|
</ClipboardCopy>
|
|
7
13
|
);
|
|
@@ -7,7 +7,12 @@ export const ClipboardCopyInlineCompactInSentence: React.FunctionComponent = ()
|
|
|
7
7
|
<br />
|
|
8
8
|
Lorem ipsum{' '}
|
|
9
9
|
{
|
|
10
|
-
<ClipboardCopy
|
|
10
|
+
<ClipboardCopy
|
|
11
|
+
copyAriaLabel="Copy inline compact basic example"
|
|
12
|
+
hoverTip="Copy"
|
|
13
|
+
clickTip="Copied"
|
|
14
|
+
variant="inline-compact"
|
|
15
|
+
>
|
|
11
16
|
2.3.4-2-redhat
|
|
12
17
|
</ClipboardCopy>
|
|
13
18
|
}
|
|
@@ -17,7 +22,12 @@ export const ClipboardCopyInlineCompactInSentence: React.FunctionComponent = ()
|
|
|
17
22
|
<br />
|
|
18
23
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit.{' '}
|
|
19
24
|
{
|
|
20
|
-
<ClipboardCopy
|
|
25
|
+
<ClipboardCopy
|
|
26
|
+
copyAriaLabel="Copy inline compact long copy string example"
|
|
27
|
+
hoverTip="Copy"
|
|
28
|
+
clickTip="Copied"
|
|
29
|
+
variant="inline-compact"
|
|
30
|
+
>
|
|
21
31
|
https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
|
|
22
32
|
</ClipboardCopy>
|
|
23
33
|
}{' '}
|
|
@@ -27,7 +37,13 @@ export const ClipboardCopyInlineCompactInSentence: React.FunctionComponent = ()
|
|
|
27
37
|
<br />
|
|
28
38
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit.{' '}
|
|
29
39
|
{
|
|
30
|
-
<ClipboardCopy
|
|
40
|
+
<ClipboardCopy
|
|
41
|
+
copyAriaLabel="Copy inline compact long copy string in block example"
|
|
42
|
+
hoverTip="Copy"
|
|
43
|
+
clickTip="Copied"
|
|
44
|
+
variant="inline-compact"
|
|
45
|
+
isBlock
|
|
46
|
+
>
|
|
31
47
|
https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
|
|
32
48
|
</ClipboardCopy>
|
|
33
49
|
}{' '}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { ClipboardCopy } from '@patternfly/react-core';
|
|
2
2
|
export const ClipboardCopyInlineCompactTruncation: React.FunctionComponent = () => (
|
|
3
3
|
<>
|
|
4
|
-
<ClipboardCopy
|
|
4
|
+
<ClipboardCopy
|
|
5
|
+
copyAriaLabel="Copy inline compact with truncation at end example"
|
|
6
|
+
truncation
|
|
7
|
+
hoverTip="Copy"
|
|
8
|
+
clickTip="Copied"
|
|
9
|
+
variant="inline-compact"
|
|
10
|
+
>
|
|
5
11
|
This lengthy, copyable content will be truncated with default settings when the truncation prop is simply set to
|
|
6
12
|
true. This is useful for quickly applying truncation without needing to worry about any other properties to set.
|
|
7
13
|
</ClipboardCopy>
|
|
8
14
|
<br />
|
|
9
15
|
<br />
|
|
10
|
-
<ClipboardCopy
|
|
16
|
+
<ClipboardCopy
|
|
17
|
+
copyAriaLabel="Copy inline compact with truncation at start example"
|
|
18
|
+
truncation={{ position: 'start' }}
|
|
19
|
+
hoverTip="Copy"
|
|
20
|
+
clickTip="Copied"
|
|
21
|
+
variant="inline-compact"
|
|
22
|
+
>
|
|
11
23
|
This lengthy, copyable content will be truncated with customized settings when the truncation prop is passed an
|
|
12
24
|
object containing Truncate props. This is useful for finetuning truncation for your particular use-case.
|
|
13
25
|
</ClipboardCopy>
|
package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompactWithAdditionalAction.tsx
CHANGED
|
@@ -8,6 +8,7 @@ export const ClipboardCopyInlineCompactWithAdditionalAction: React.FunctionCompo
|
|
|
8
8
|
const doneRunText: string = 'Running in web terminal';
|
|
9
9
|
return (
|
|
10
10
|
<ClipboardCopy
|
|
11
|
+
copyAriaLabel="Copy inline compact with additional action example"
|
|
11
12
|
hoverTip="Copy"
|
|
12
13
|
clickTip="Copied"
|
|
13
14
|
variant="inline-compact"
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
|
|
2
2
|
|
|
3
3
|
export const ClipboardCopyJSONObject: React.FunctionComponent = () => (
|
|
4
|
-
<ClipboardCopy
|
|
4
|
+
<ClipboardCopy
|
|
5
|
+
copyAriaLabel="Copy JSON object example"
|
|
6
|
+
toggleAriaLabel="Show content for JSON object example"
|
|
7
|
+
isCode
|
|
8
|
+
hoverTip="Copy"
|
|
9
|
+
clickTip="Copied"
|
|
10
|
+
variant={ClipboardCopyVariant.expansion}
|
|
11
|
+
>
|
|
5
12
|
{`{ "menu": {
|
|
6
13
|
"id": "file",
|
|
7
14
|
"value": "File",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClipboardCopy } from '@patternfly/react-core';
|
|
2
2
|
|
|
3
3
|
export const ClipboardCopyReadOnly: React.FunctionComponent = () => (
|
|
4
|
-
<ClipboardCopy isReadOnly hoverTip="Copy" clickTip="Copied">
|
|
4
|
+
<ClipboardCopy copyAriaLabel="Copy read-only example" isReadOnly hoverTip="Copy" clickTip="Copied">
|
|
5
5
|
This is read-only
|
|
6
6
|
</ClipboardCopy>
|
|
7
7
|
);
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
|
|
2
2
|
|
|
3
3
|
export const ClipboardCopyReadOnlyExpanded: React.FunctionComponent = () => (
|
|
4
|
-
<ClipboardCopy
|
|
4
|
+
<ClipboardCopy
|
|
5
|
+
toggleAriaLabel="Show content for read-only expanded example"
|
|
6
|
+
copyAriaLabel="Copy read-only expanded example"
|
|
7
|
+
isReadOnly
|
|
8
|
+
hoverTip="Copy"
|
|
9
|
+
clickTip="Copied"
|
|
10
|
+
variant={ClipboardCopyVariant.expansion}
|
|
11
|
+
>
|
|
5
12
|
Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
|
|
6
13
|
expansion.
|
|
7
14
|
</ClipboardCopy>
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
|
|
2
2
|
|
|
3
3
|
export const ClipboardCopyReadOnlyExpandedByDefault: React.FunctionComponent = () => (
|
|
4
|
-
<ClipboardCopy
|
|
4
|
+
<ClipboardCopy
|
|
5
|
+
copyAriaLabel="Copy read-only expanded by default example"
|
|
6
|
+
toggleAriaLabel="Show content for read-only expanded by default example"
|
|
7
|
+
isReadOnly
|
|
8
|
+
isExpanded
|
|
9
|
+
hoverTip="Copy"
|
|
10
|
+
clickTip="Copied"
|
|
11
|
+
variant={ClipboardCopyVariant.expansion}
|
|
12
|
+
>
|
|
5
13
|
Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
|
|
6
14
|
expansion.
|
|
7
15
|
</ClipboardCopy>
|
|
@@ -116,7 +116,7 @@ export const WizardNavItem = ({
|
|
|
116
116
|
<span className={css(styles.wizardNavLinkMain)}>
|
|
117
117
|
{isExpandable ? (
|
|
118
118
|
<>
|
|
119
|
-
<span className=
|
|
119
|
+
<span className="pf-v6-c-wizard__nav-link-text">{content}</span>
|
|
120
120
|
<span className={css(styles.wizardNavLinkToggle)}>
|
|
121
121
|
<span className={css(styles.wizardNavLinkToggleIcon)}>
|
|
122
122
|
<AngleRightIcon aria-label={`${isCurrent ? 'Collapse' : 'Expand'} step icon`} />
|
|
@@ -92,7 +92,7 @@ export const WizardNavItem: React.FunctionComponent<WizardNavItemProps> = ({
|
|
|
92
92
|
<span className={css(styles.wizardNavLinkMain)}>
|
|
93
93
|
{isExpandable ? (
|
|
94
94
|
<>
|
|
95
|
-
<span className=
|
|
95
|
+
<span className="pf-v6-c-wizard__nav-link-text">{content}</span>
|
|
96
96
|
<span className={css(styles.wizardNavLinkToggle)}>
|
|
97
97
|
<span className={css(styles.wizardNavLinkToggleIcon)}>
|
|
98
98
|
<AngleRightIcon />
|