@patternfly/react-core 4.252.2 → 4.253.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +6 -1
  3. package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
  4. package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +5 -3
  5. package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
  6. package/dist/esm/components/Slider/Slider.js +2 -2
  7. package/dist/esm/components/Slider/Slider.js.map +1 -1
  8. package/dist/esm/components/Wizard/WizardNav.d.ts +2 -1
  9. package/dist/esm/components/Wizard/WizardNav.d.ts.map +1 -1
  10. package/dist/esm/components/Wizard/WizardNav.js +4 -2
  11. package/dist/esm/components/Wizard/WizardNav.js.map +1 -1
  12. package/dist/esm/components/Wizard/WizardNavItem.d.ts +2 -1
  13. package/dist/esm/components/Wizard/WizardNavItem.d.ts.map +1 -1
  14. package/dist/esm/components/Wizard/WizardNavItem.js +4 -2
  15. package/dist/esm/components/Wizard/WizardNavItem.js.map +1 -1
  16. package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +6 -1
  17. package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
  18. package/dist/js/components/ClipboardCopy/ClipboardCopy.js +5 -3
  19. package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
  20. package/dist/js/components/Slider/Slider.js +2 -2
  21. package/dist/js/components/Slider/Slider.js.map +1 -1
  22. package/dist/js/components/Wizard/WizardNav.d.ts +2 -1
  23. package/dist/js/components/Wizard/WizardNav.d.ts.map +1 -1
  24. package/dist/js/components/Wizard/WizardNav.js +4 -2
  25. package/dist/js/components/Wizard/WizardNav.js.map +1 -1
  26. package/dist/js/components/Wizard/WizardNavItem.d.ts +2 -1
  27. package/dist/js/components/Wizard/WizardNavItem.d.ts.map +1 -1
  28. package/dist/js/components/Wizard/WizardNavItem.js +4 -2
  29. package/dist/js/components/Wizard/WizardNavItem.js.map +1 -1
  30. package/dist/umd/react-core.min.css +756 -756
  31. package/dist/umd/react-core.min.js +2 -2
  32. package/package.json +2 -2
  33. package/src/components/ClipboardCopy/ClipboardCopy.tsx +11 -2
  34. package/src/components/ClipboardCopy/__tests__/Generated/__snapshots__/ClipboardCopy.test.tsx.snap +2 -0
  35. package/src/components/ClipboardCopy/examples/ClipboardCopy.md +1 -0
  36. package/src/components/Slider/Slider.tsx +3 -3
  37. package/src/components/Slider/_tests_/__snapshots__/Slider.test.tsx.snap +11 -11
  38. package/src/components/Wizard/WizardNav.tsx +8 -2
  39. package/src/components/Wizard/WizardNavItem.tsx +6 -1
  40. package/src/components/Wizard/__tests__/Generated/__snapshots__/WizardNav.test.tsx.snap +3 -0
  41. package/src/components/Wizard/__tests__/Generated/__snapshots__/WizardNavItem.test.tsx.snap +3 -0
  42. package/src/components/Wizard/__tests__/__snapshots__/Wizard.test.tsx.snap +48 -0
  43. package/src/components/Wizard/examples/Wizard.md +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.252.2",
3
+ "version": "4.253.1",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -70,5 +70,5 @@
70
70
  "react": "^16.8 || ^17 || ^18",
71
71
  "react-dom": "^16.8 || ^17 || ^18"
72
72
  },
73
- "gitHead": "5e61ce3e4bc89c664c84c7b2b3608fc40c900c3e"
73
+ "gitHead": "ef07e5bd27b1048e5f63b88a822ef3357e8c8e3e"
74
74
  }
@@ -9,6 +9,7 @@ import { GenerateId } from '../../helpers/GenerateId/GenerateId';
9
9
  import { ClipboardCopyButton } from './ClipboardCopyButton';
10
10
  import { ClipboardCopyToggle } from './ClipboardCopyToggle';
11
11
  import { ClipboardCopyExpanded } from './ClipboardCopyExpanded';
12
+ import { getOUIAProps, OUIAProps } from '../../helpers';
12
13
 
13
14
  export const clipboardCopyFunc = (event: React.ClipboardEvent<HTMLDivElement>, text?: React.ReactNode) => {
14
15
  const clipboard = event.currentTarget.parentElement;
@@ -32,7 +33,7 @@ export interface ClipboardCopyState {
32
33
  copied: boolean;
33
34
  }
34
35
 
35
- export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange'> {
36
+ export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange'>, OUIAProps {
36
37
  /** Additional classes added to the clipboard copy container. */
37
38
  className?: string;
38
39
  /** Tooltip message to display when hover the copy button */
@@ -86,6 +87,10 @@ export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>
86
87
  children: React.ReactNode;
87
88
  /** Additional actions for inline clipboard copy. Should be wrapped with ClipboardCopyAction. */
88
89
  additionalActions?: React.ReactNode;
90
+ /** Value to overwrite the randomly generated data-ouia-component-id.*/
91
+ ouiaId?: number | string;
92
+ /** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
93
+ ouiaSafe?: boolean;
89
94
  }
90
95
 
91
96
  export class ClipboardCopy extends React.Component<ClipboardCopyProps, ClipboardCopyState> {
@@ -118,7 +123,8 @@ export class ClipboardCopy extends React.Component<ClipboardCopyProps, Clipboard
118
123
  onChange: (): any => undefined,
119
124
  textAriaLabel: 'Copyable input',
120
125
  toggleAriaLabel: 'Show content',
121
- additionalActions: null
126
+ additionalActions: null,
127
+ ouiaSafe: true
122
128
  };
123
129
 
124
130
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -168,6 +174,8 @@ export class ClipboardCopy extends React.Component<ClipboardCopyProps, Clipboard
168
174
  position,
169
175
  className,
170
176
  additionalActions,
177
+ ouiaId,
178
+ ouiaSafe,
171
179
  ...divProps
172
180
  } = this.props;
173
181
  const textIdPrefix = 'text-input-';
@@ -183,6 +191,7 @@ export class ClipboardCopy extends React.Component<ClipboardCopyProps, Clipboard
183
191
  className
184
192
  )}
185
193
  {...divProps}
194
+ {...getOUIAProps(ClipboardCopy.displayName, ouiaId, ouiaSafe)}
186
195
  >
187
196
  {variant === 'inline-compact' && (
188
197
  <GenerateId prefix="">
@@ -4,6 +4,8 @@ exports[`ClipboardCopy should match snapshot (auto-generated) 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
6
  class="pf-c-clipboard-copy string"
7
+ data-ouia-component-type="PF4/ClipboardCopy"
8
+ data-ouia-safe="true"
7
9
  >
8
10
  <div
9
11
  class="pf-c-clipboard-copy__group"
@@ -3,6 +3,7 @@ id: Clipboard copy
3
3
  section: components
4
4
  cssPrefix: pf-c-copyclipboard
5
5
  propComponents: ['ClipboardCopy', 'ClipboardCopyButton']
6
+ ouia: true
6
7
  ---
7
8
 
8
9
  import PlayIcon from '@patternfly/react-icons/dist/esm/icons/play-icon';
@@ -416,9 +416,6 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
416
416
  {buildSteps()}
417
417
  </div>
418
418
  )}
419
- {isInputVisible && inputPosition === 'aboveThumb' && (
420
- <div className={css(styles.sliderValue, styles.modifiers.floating)}>{displayInput()}</div>
421
- )}
422
419
  {hasTooltipOverThumb ? (
423
420
  <Tooltip entryDelay={0} content={findAriaTextValue()}>
424
421
  {thumbComponent}
@@ -426,6 +423,9 @@ export const Slider: React.FunctionComponent<SliderProps> = ({
426
423
  ) : (
427
424
  thumbComponent
428
425
  )}
426
+ {isInputVisible && inputPosition === 'aboveThumb' && (
427
+ <div className={css(styles.sliderValue, styles.modifiers.floating)}>{displayInput()}</div>
428
+ )}
429
429
  </div>
430
430
  {isInputVisible && inputPosition === 'right' && <div className={css(styles.sliderValue)}>{displayInput()}</div>}
431
431
  {rightActions && <div className={css(styles.sliderActions)}>{rightActions}</div>}
@@ -475,6 +475,17 @@ exports[`slider renders slider with input above thumb 1`] = `
475
475
  </div>
476
476
  </div>
477
477
  </div>
478
+ <div
479
+ aria-disabled="false"
480
+ aria-label="Value"
481
+ aria-valuemax="100"
482
+ aria-valuemin="0"
483
+ aria-valuenow="50"
484
+ aria-valuetext="50"
485
+ class="pf-c-slider__thumb"
486
+ role="slider"
487
+ tabindex="0"
488
+ />
478
489
  <div
479
490
  class="pf-c-slider__value pf-m-floating"
480
491
  >
@@ -498,17 +509,6 @@ exports[`slider renders slider with input above thumb 1`] = `
498
509
  </span>
499
510
  </div>
500
511
  </div>
501
- <div
502
- aria-disabled="false"
503
- aria-label="Value"
504
- aria-valuemax="100"
505
- aria-valuemin="0"
506
- aria-valuenow="50"
507
- aria-valuetext="50"
508
- class="pf-c-slider__thumb"
509
- role="slider"
510
- tabindex="0"
511
- />
512
512
  </div>
513
513
  </div>
514
514
  </DocumentFragment>
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
3
3
  import { css } from '@patternfly/react-styles';
4
+ import { useOUIAProps, OUIAProps } from '../../helpers';
4
5
 
5
- export interface WizardNavProps {
6
+ export interface WizardNavProps extends OUIAProps {
6
7
  /** children should be WizardNavItem components */
7
8
  children?: any;
8
9
  /** Aria-label applied to the nav element */
@@ -20,8 +21,12 @@ export const WizardNav: React.FunctionComponent<WizardNavProps> = ({
20
21
  'aria-label': ariaLabel,
21
22
  'aria-labelledby': ariaLabelledBy,
22
23
  isOpen = false,
23
- returnList = false
24
+ returnList = false,
25
+ ouiaId,
26
+ ouiaSafe = true
24
27
  }: WizardNavProps) => {
28
+ const ouiaProps = useOUIAProps(WizardNav.displayName, ouiaId, ouiaSafe);
29
+
25
30
  const innerList = <ol className={css(styles.wizardNavList)}>{children}</ol>;
26
31
 
27
32
  if (returnList) {
@@ -33,6 +38,7 @@ export const WizardNav: React.FunctionComponent<WizardNavProps> = ({
33
38
  className={css(styles.wizardNav, isOpen && styles.modifiers.expanded)}
34
39
  aria-label={ariaLabel}
35
40
  aria-labelledby={ariaLabelledBy}
41
+ {...ouiaProps}
36
42
  >
37
43
  <ol className={css(styles.wizardNavList)}>{children}</ol>
38
44
  </nav>
@@ -2,8 +2,9 @@ import * as React from 'react';
2
2
  import { css } from '@patternfly/react-styles';
3
3
  import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
4
4
  import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
5
+ import { useOUIAProps, OUIAProps } from '../../helpers';
5
6
 
6
- export interface WizardNavItemProps {
7
+ export interface WizardNavItemProps extends OUIAProps {
7
8
  /** Can nest a WizardNav component for substeps */
8
9
  children?: React.ReactNode;
9
10
  /** The content to display in the nav item */
@@ -37,8 +38,11 @@ export const WizardNavItem: React.FunctionComponent<WizardNavItemProps> = ({
37
38
  href = null,
38
39
  isExpandable = false,
39
40
  id,
41
+ ouiaId,
42
+ ouiaSafe = true,
40
43
  ...rest
41
44
  }: WizardNavItemProps) => {
45
+ const ouiaProps = useOUIAProps(WizardNavItem.displayName, ouiaId, ouiaSafe);
42
46
  const NavItemComponent = navItemComponent;
43
47
 
44
48
  const [isExpanded, setIsExpanded] = React.useState(false);
@@ -82,6 +86,7 @@ export const WizardNavItem: React.FunctionComponent<WizardNavItemProps> = ({
82
86
  aria-disabled={isDisabled ? true : null}
83
87
  aria-current={isCurrent && !children ? 'step' : false}
84
88
  {...(isExpandable && { 'aria-expanded': isExpanded })}
89
+ {...ouiaProps}
85
90
  >
86
91
  {isExpandable ? (
87
92
  <>
@@ -6,6 +6,9 @@ exports[`WizardNav should match snapshot (auto-generated) 1`] = `
6
6
  aria-label="string"
7
7
  aria-labelledby="string"
8
8
  class="pf-c-wizard__nav"
9
+ data-ouia-component-id="OUIA-Generated-WizardNav-1"
10
+ data-ouia-component-type="PF4/WizardNav"
11
+ data-ouia-safe="true"
9
12
  >
10
13
  <ol
11
14
  class="pf-c-wizard__nav-list"
@@ -8,6 +8,9 @@ exports[`WizardNavItem should match snapshot (auto-generated) 1`] = `
8
8
  <button
9
9
  aria-current="false"
10
10
  class="pf-c-wizard__nav-link"
11
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-1"
12
+ data-ouia-component-type="PF4/WizardNavItem"
13
+ data-ouia-safe="true"
11
14
  />
12
15
  ReactNode
13
16
  </li>
@@ -94,6 +94,9 @@ exports[`Wizard Expandable Nav Wizard should match snapshot 1`] = `
94
94
  <nav
95
95
  aria-labelledby="pf-wizard-title-1"
96
96
  class="pf-c-wizard__nav"
97
+ data-ouia-component-id="OUIA-Generated-WizardNav-3"
98
+ data-ouia-component-type="PF4/WizardNav"
99
+ data-ouia-safe="true"
97
100
  >
98
101
  <ol
99
102
  class="pf-c-wizard__nav-list"
@@ -104,6 +107,9 @@ exports[`Wizard Expandable Nav Wizard should match snapshot 1`] = `
104
107
  <button
105
108
  aria-current="step"
106
109
  class="pf-c-wizard__nav-link pf-m-current"
110
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-7"
111
+ data-ouia-component-type="PF4/WizardNavItem"
112
+ data-ouia-safe="true"
107
113
  >
108
114
  A
109
115
  </button>
@@ -115,6 +121,9 @@ exports[`Wizard Expandable Nav Wizard should match snapshot 1`] = `
115
121
  aria-current="false"
116
122
  aria-expanded="false"
117
123
  class="pf-c-wizard__nav-link"
124
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-8"
125
+ data-ouia-component-type="PF4/WizardNavItem"
126
+ data-ouia-safe="true"
118
127
  >
119
128
  <span
120
129
  class="pf-c-wizard__nav-link-text"
@@ -152,6 +161,9 @@ exports[`Wizard Expandable Nav Wizard should match snapshot 1`] = `
152
161
  <button
153
162
  aria-current="false"
154
163
  class="pf-c-wizard__nav-link"
164
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-9"
165
+ data-ouia-component-type="PF4/WizardNavItem"
166
+ data-ouia-safe="true"
155
167
  >
156
168
  B-1
157
169
  </button>
@@ -162,6 +174,9 @@ exports[`Wizard Expandable Nav Wizard should match snapshot 1`] = `
162
174
  <button
163
175
  aria-current="false"
164
176
  class="pf-c-wizard__nav-link"
177
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-10"
178
+ data-ouia-component-type="PF4/WizardNavItem"
179
+ data-ouia-safe="true"
165
180
  >
166
181
  B-2
167
182
  </button>
@@ -174,6 +189,9 @@ exports[`Wizard Expandable Nav Wizard should match snapshot 1`] = `
174
189
  <button
175
190
  aria-current="false"
176
191
  class="pf-c-wizard__nav-link"
192
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-11"
193
+ data-ouia-component-type="PF4/WizardNavItem"
194
+ data-ouia-safe="true"
177
195
  >
178
196
  C
179
197
  </button>
@@ -184,6 +202,9 @@ exports[`Wizard Expandable Nav Wizard should match snapshot 1`] = `
184
202
  <button
185
203
  aria-current="false"
186
204
  class="pf-c-wizard__nav-link"
205
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-12"
206
+ data-ouia-component-type="PF4/WizardNavItem"
207
+ data-ouia-safe="true"
187
208
  >
188
209
  D
189
210
  </button>
@@ -341,6 +362,9 @@ exports[`Wizard Wizard should match snapshot 1`] = `
341
362
  <nav
342
363
  aria-labelledby="pf-wizard-title-0"
343
364
  class="pf-c-wizard__nav"
365
+ data-ouia-component-id="OUIA-Generated-WizardNav-1"
366
+ data-ouia-component-type="PF4/WizardNav"
367
+ data-ouia-safe="true"
344
368
  >
345
369
  <ol
346
370
  class="pf-c-wizard__nav-list"
@@ -351,6 +375,9 @@ exports[`Wizard Wizard should match snapshot 1`] = `
351
375
  <button
352
376
  aria-current="step"
353
377
  class="pf-c-wizard__nav-link pf-m-current"
378
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-1"
379
+ data-ouia-component-type="PF4/WizardNavItem"
380
+ data-ouia-safe="true"
354
381
  id="step-A"
355
382
  >
356
383
  A
@@ -362,6 +389,9 @@ exports[`Wizard Wizard should match snapshot 1`] = `
362
389
  <button
363
390
  aria-current="false"
364
391
  class="pf-c-wizard__nav-link"
392
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-2"
393
+ data-ouia-component-type="PF4/WizardNavItem"
394
+ data-ouia-safe="true"
365
395
  id="step-B"
366
396
  >
367
397
  B
@@ -375,6 +405,9 @@ exports[`Wizard Wizard should match snapshot 1`] = `
375
405
  <button
376
406
  aria-current="false"
377
407
  class="pf-c-wizard__nav-link"
408
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-3"
409
+ data-ouia-component-type="PF4/WizardNavItem"
410
+ data-ouia-safe="true"
378
411
  id="step-B-1"
379
412
  >
380
413
  B-1
@@ -386,6 +419,9 @@ exports[`Wizard Wizard should match snapshot 1`] = `
386
419
  <button
387
420
  aria-current="false"
388
421
  class="pf-c-wizard__nav-link"
422
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-4"
423
+ data-ouia-component-type="PF4/WizardNavItem"
424
+ data-ouia-safe="true"
389
425
  id="step-B-2"
390
426
  >
391
427
  B-2
@@ -399,6 +435,9 @@ exports[`Wizard Wizard should match snapshot 1`] = `
399
435
  <button
400
436
  aria-current="false"
401
437
  class="pf-c-wizard__nav-link"
438
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-5"
439
+ data-ouia-component-type="PF4/WizardNavItem"
440
+ data-ouia-safe="true"
402
441
  id="step-C"
403
442
  >
404
443
  C
@@ -410,6 +449,9 @@ exports[`Wizard Wizard should match snapshot 1`] = `
410
449
  <button
411
450
  aria-current="false"
412
451
  class="pf-c-wizard__nav-link"
452
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-6"
453
+ data-ouia-component-type="PF4/WizardNavItem"
454
+ data-ouia-safe="true"
413
455
  id="step-D"
414
456
  >
415
457
  D
@@ -525,6 +567,9 @@ exports[`Wizard bare wiz 1`] = `
525
567
  >
526
568
  <nav
527
569
  class="pf-c-wizard__nav"
570
+ data-ouia-component-id="OUIA-Generated-WizardNav-5"
571
+ data-ouia-component-type="PF4/WizardNav"
572
+ data-ouia-safe="true"
528
573
  >
529
574
  <ol
530
575
  class="pf-c-wizard__nav-list"
@@ -535,6 +580,9 @@ exports[`Wizard bare wiz 1`] = `
535
580
  <button
536
581
  aria-current="step"
537
582
  class="pf-c-wizard__nav-link pf-m-current"
583
+ data-ouia-component-id="OUIA-Generated-WizardNavItem-13"
584
+ data-ouia-component-type="PF4/WizardNavItem"
585
+ data-ouia-safe="true"
538
586
  >
539
587
  A
540
588
  </button>
@@ -4,6 +4,7 @@ section: components
4
4
  cssPrefix: pf-c-wizard
5
5
  propComponents:
6
6
  ['Wizard', 'WizardNav', 'WizardNavItem', 'WizardHeader', 'WizardBody', 'WizardFooter', 'WizardToggle', 'WizardStep']
7
+ ouia: true
7
8
  ---
8
9
 
9
10
  import { Button, Drawer, DrawerActions, DrawerCloseButton, DrawerColorVariant,
@@ -812,10 +813,10 @@ class GetCurrentStepWizard extends React.Component {
812
813
  step: 1
813
814
  };
814
815
  this.onCurrentStepChanged = ({ id }) => {
815
- this.setState({
816
- step: id
817
- });
818
- }
816
+ this.setState({
817
+ step: id
818
+ });
819
+ };
819
820
  this.closeWizard = () => {
820
821
  console.log('close wizard');
821
822
  };