@patternfly/react-core 6.0.0-alpha.29 → 6.0.0-alpha.30

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 (145) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/components/package.json +1 -1
  3. package/deprecated/package.json +1 -1
  4. package/dist/dynamic/components/AboutModal/package.json +1 -1
  5. package/dist/dynamic/components/Accordion/package.json +1 -1
  6. package/dist/dynamic/components/ActionList/package.json +1 -1
  7. package/dist/dynamic/components/Alert/package.json +1 -1
  8. package/dist/dynamic/components/Avatar/package.json +1 -1
  9. package/dist/dynamic/components/BackToTop/package.json +1 -1
  10. package/dist/dynamic/components/Backdrop/package.json +1 -1
  11. package/dist/dynamic/components/BackgroundImage/package.json +1 -1
  12. package/dist/dynamic/components/Badge/package.json +1 -1
  13. package/dist/dynamic/components/Banner/package.json +1 -1
  14. package/dist/dynamic/components/Brand/package.json +1 -1
  15. package/dist/dynamic/components/Breadcrumb/package.json +1 -1
  16. package/dist/dynamic/components/Button/package.json +1 -1
  17. package/dist/dynamic/components/CalendarMonth/package.json +1 -1
  18. package/dist/dynamic/components/Card/package.json +1 -1
  19. package/dist/dynamic/components/Checkbox/package.json +1 -1
  20. package/dist/dynamic/components/Chip/package.json +1 -1
  21. package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
  22. package/dist/dynamic/components/CodeBlock/package.json +1 -1
  23. package/dist/dynamic/components/DataList/package.json +1 -1
  24. package/dist/dynamic/components/DatePicker/package.json +1 -1
  25. package/dist/dynamic/components/DescriptionList/package.json +1 -1
  26. package/dist/dynamic/components/Divider/package.json +1 -1
  27. package/dist/dynamic/components/DragDrop/package.json +1 -1
  28. package/dist/dynamic/components/Drawer/package.json +1 -1
  29. package/dist/dynamic/components/Dropdown/package.json +1 -1
  30. package/dist/dynamic/components/DualListSelector/package.json +1 -1
  31. package/dist/dynamic/components/EmptyState/package.json +1 -1
  32. package/dist/dynamic/components/ExpandableSection/package.json +1 -1
  33. package/dist/dynamic/components/FileUpload/package.json +1 -1
  34. package/dist/dynamic/components/Form/package.json +1 -1
  35. package/dist/dynamic/components/FormSelect/package.json +1 -1
  36. package/dist/dynamic/components/HelperText/package.json +1 -1
  37. package/dist/dynamic/components/Hint/package.json +1 -1
  38. package/dist/dynamic/components/Icon/package.json +1 -1
  39. package/dist/dynamic/components/InputGroup/package.json +1 -1
  40. package/dist/dynamic/components/JumpLinks/package.json +1 -1
  41. package/dist/dynamic/components/Label/package.json +1 -1
  42. package/dist/dynamic/components/List/package.json +1 -1
  43. package/dist/dynamic/components/LoginPage/package.json +1 -1
  44. package/dist/dynamic/components/Masthead/package.json +1 -1
  45. package/dist/dynamic/components/Menu/package.json +1 -1
  46. package/dist/dynamic/components/MenuToggle/package.json +1 -1
  47. package/dist/dynamic/components/Modal/package.json +1 -1
  48. package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
  49. package/dist/dynamic/components/Nav/package.json +1 -1
  50. package/dist/dynamic/components/NotificationBadge/package.json +1 -1
  51. package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
  52. package/dist/dynamic/components/NumberInput/package.json +1 -1
  53. package/dist/dynamic/components/OverflowMenu/package.json +1 -1
  54. package/dist/dynamic/components/Page/package.json +1 -1
  55. package/dist/dynamic/components/Pagination/package.json +1 -1
  56. package/dist/dynamic/components/Panel/package.json +1 -1
  57. package/dist/dynamic/components/Popover/package.json +1 -1
  58. package/dist/dynamic/components/Progress/package.json +1 -1
  59. package/dist/dynamic/components/ProgressStepper/package.json +1 -1
  60. package/dist/dynamic/components/Radio/package.json +1 -1
  61. package/dist/dynamic/components/SearchInput/package.json +1 -1
  62. package/dist/dynamic/components/Select/package.json +1 -1
  63. package/dist/dynamic/components/Sidebar/package.json +1 -1
  64. package/dist/dynamic/components/SimpleList/package.json +1 -1
  65. package/dist/dynamic/components/Skeleton/package.json +1 -1
  66. package/dist/dynamic/components/SkipToContent/package.json +1 -1
  67. package/dist/dynamic/components/Slider/package.json +1 -1
  68. package/dist/dynamic/components/Spinner/package.json +1 -1
  69. package/dist/dynamic/components/Switch/package.json +1 -1
  70. package/dist/dynamic/components/Tabs/package.json +1 -1
  71. package/dist/dynamic/components/Text/package.json +1 -1
  72. package/dist/dynamic/components/TextArea/package.json +1 -1
  73. package/dist/dynamic/components/TextInput/package.json +1 -1
  74. package/dist/dynamic/components/TextInputGroup/package.json +1 -1
  75. package/dist/dynamic/components/Tile/package.json +1 -1
  76. package/dist/dynamic/components/TimePicker/package.json +1 -1
  77. package/dist/dynamic/components/Timestamp/package.json +1 -1
  78. package/dist/dynamic/components/Title/package.json +1 -1
  79. package/dist/dynamic/components/ToggleGroup/package.json +1 -1
  80. package/dist/dynamic/components/Toolbar/package.json +1 -1
  81. package/dist/dynamic/components/Tooltip/package.json +1 -1
  82. package/dist/dynamic/components/TreeView/package.json +1 -1
  83. package/dist/dynamic/components/Truncate/package.json +1 -1
  84. package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
  85. package/dist/dynamic/components/Wizard/package.json +1 -1
  86. package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
  87. package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
  88. package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
  89. package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
  90. package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
  91. package/dist/dynamic/deprecated/components/Select/package.json +1 -1
  92. package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
  93. package/dist/dynamic/deprecated/components/package.json +1 -1
  94. package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
  95. package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
  96. package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
  97. package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
  98. package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
  99. package/dist/dynamic/helpers/constants/package.json +1 -1
  100. package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
  101. package/dist/dynamic/helpers/favorites/package.json +1 -1
  102. package/dist/dynamic/helpers/fileUtils/package.json +1 -1
  103. package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
  104. package/dist/dynamic/helpers/package.json +1 -1
  105. package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
  106. package/dist/dynamic/helpers/typeUtils/package.json +1 -1
  107. package/dist/dynamic/helpers/useInterval/package.json +1 -1
  108. package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
  109. package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
  110. package/dist/dynamic/helpers/util/package.json +1 -1
  111. package/dist/dynamic/layouts/Bullseye/package.json +1 -1
  112. package/dist/dynamic/layouts/Flex/package.json +1 -1
  113. package/dist/dynamic/layouts/Gallery/package.json +1 -1
  114. package/dist/dynamic/layouts/Grid/package.json +1 -1
  115. package/dist/dynamic/layouts/Level/package.json +1 -1
  116. package/dist/dynamic/layouts/Split/package.json +1 -1
  117. package/dist/dynamic/layouts/Stack/package.json +1 -1
  118. package/dist/dynamic/next/components/Modal/package.json +1 -1
  119. package/dist/dynamic/next/components/package.json +1 -1
  120. package/dist/dynamic/styles/package.json +1 -1
  121. package/dist/esm/components/JumpLinks/JumpLinks.js.map +1 -1
  122. package/dist/esm/components/JumpLinks/JumpLinksItem.d.ts +2 -2
  123. package/dist/esm/components/JumpLinks/JumpLinksItem.d.ts.map +1 -1
  124. package/dist/esm/components/JumpLinks/JumpLinksItem.js +4 -2
  125. package/dist/esm/components/JumpLinks/JumpLinksItem.js.map +1 -1
  126. package/dist/js/components/JumpLinks/JumpLinks.js.map +1 -1
  127. package/dist/js/components/JumpLinks/JumpLinksItem.d.ts +2 -2
  128. package/dist/js/components/JumpLinks/JumpLinksItem.d.ts.map +1 -1
  129. package/dist/js/components/JumpLinks/JumpLinksItem.js +4 -2
  130. package/dist/js/components/JumpLinks/JumpLinksItem.js.map +1 -1
  131. package/dist/umd/react-core.min.js +1 -1
  132. package/helpers/package.json +1 -1
  133. package/layouts/package.json +1 -1
  134. package/next/package.json +1 -1
  135. package/package.json +2 -2
  136. package/src/components/JumpLinks/JumpLinks.tsx +2 -2
  137. package/src/components/JumpLinks/JumpLinksItem.tsx +8 -5
  138. package/src/components/JumpLinks/__tests__/JumpLinks.test.tsx +29 -19
  139. package/src/components/JumpLinks/__tests__/__snapshots__/JumpLinks.test.tsx.snap +285 -114
  140. package/src/components/JumpLinks/examples/JumpLinksBasic.tsx +5 -3
  141. package/src/components/JumpLinks/examples/JumpLinksExpandableVerticalWithSubsection.tsx +9 -7
  142. package/src/components/JumpLinks/examples/JumpLinksVertical.tsx +5 -3
  143. package/src/components/JumpLinks/examples/JumpLinksVerticalWithLabel.tsx +5 -3
  144. package/src/components/JumpLinks/examples/JumpLinksWithCenteredList.tsx +5 -3
  145. package/src/components/JumpLinks/examples/JumpLinksWithLabel.tsx +10 -6
@@ -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.0.0-alpha.28","private":true}
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.0.0-alpha.29","private":true}
@@ -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.0.0-alpha.28","private":true}
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.0.0-alpha.29","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.0.0-alpha.28","private":true}
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.0.0-alpha.29","private":true}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "6.0.0-alpha.29",
3
+ "version": "6.0.0-alpha.30",
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",
@@ -73,5 +73,5 @@
73
73
  "react": "^17 || ^18",
74
74
  "react-dom": "^17 || ^18"
75
75
  },
76
- "gitHead": "7205b29995cc7d458b96724eb13e6aef2ccb2f81"
76
+ "gitHead": "a0d48218e63cd489c8b59556e59989559ba8ba65"
77
77
  }
@@ -162,7 +162,7 @@ export const JumpLinks: React.FunctionComponent<JumpLinksProps> = ({
162
162
  const itemIndex = jumpLinkIndex++;
163
163
  const scrollItem = scrollItems[itemIndex];
164
164
  return React.cloneElement(child as React.ReactElement<JumpLinksItemProps>, {
165
- onClick(ev: React.MouseEvent<HTMLAnchorElement>) {
165
+ onClick(ev: React.MouseEvent) {
166
166
  isLinkClicked.current = true;
167
167
  // Items might have rendered after this component. Do a quick refresh.
168
168
  let newScrollItems;
@@ -193,7 +193,7 @@ export const JumpLinks: React.FunctionComponent<JumpLinksProps> = ({
193
193
  scrollableElement.scrollTo(0, newScrollItem.offsetTop - offset);
194
194
  }
195
195
  newScrollItem.focus();
196
- window.history.pushState('', '', ev.currentTarget.href);
196
+ window.history.pushState('', '', (ev.currentTarget as HTMLAnchorElement).href);
197
197
  ev.preventDefault();
198
198
  setActiveIndex(itemIndex);
199
199
  }
@@ -2,18 +2,19 @@ import * as React from 'react';
2
2
  import { css } from '@patternfly/react-styles';
3
3
  import styles from '@patternfly/react-styles/css/components/JumpLinks/jump-links';
4
4
  import { JumpLinksList } from './JumpLinksList';
5
+ import { Button, ButtonVariant } from '../Button';
5
6
 
6
7
  export interface JumpLinksItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'onClick'> {
7
8
  /** Whether this item is active. Parent JumpLinks component sets this when passed a `scrollableSelector`. */
8
9
  isActive?: boolean;
9
10
  /** Href for this link */
10
- href?: string;
11
+ href: string;
11
12
  /** Selector or HTMLElement to spy on */
12
13
  node?: string | HTMLElement;
13
14
  /** Text to be rendered inside span */
14
15
  children?: React.ReactNode;
15
16
  /** Click handler for anchor tag. Parent JumpLinks components tap into this. */
16
- onClick?: (ev: React.MouseEvent<HTMLAnchorElement>) => void;
17
+ onClick?: (ev: React.MouseEvent) => void;
17
18
  /** Class to add to li */
18
19
  className?: string;
19
20
  }
@@ -38,9 +39,11 @@ export const JumpLinksItem: React.FunctionComponent<JumpLinksItemProps> = ({
38
39
  {...(isActive && { 'aria-current': 'location' })}
39
40
  {...props}
40
41
  >
41
- <a className={styles.jumpLinksLink} href={href} onClick={onClick}>
42
- <span className={styles.jumpLinksLinkText}>{children}</span>
43
- </a>
42
+ <span className={styles.jumpLinksLink}>
43
+ <Button variant={ButtonVariant.link} component="a" href={href} onClick={onClick}>
44
+ <span className={styles.jumpLinksLinkText}>{children}</span>
45
+ </Button>
46
+ </span>
44
47
  {sublists}
45
48
  </li>
46
49
  );
@@ -7,9 +7,11 @@ import { JumpLinksList } from '../JumpLinksList';
7
7
  test('simple jumplinks', () => {
8
8
  const { asFragment } = render(
9
9
  <JumpLinks>
10
- <JumpLinksItem>Inactive section</JumpLinksItem>
11
- <JumpLinksItem isActive>Active section</JumpLinksItem>
12
- <JumpLinksItem>Inactive section</JumpLinksItem>
10
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
11
+ <JumpLinksItem href="#" isActive>
12
+ Active section
13
+ </JumpLinksItem>
14
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
13
15
  </JumpLinks>
14
16
  );
15
17
  expect(asFragment()).toMatchSnapshot();
@@ -18,9 +20,11 @@ test('simple jumplinks', () => {
18
20
  test('jumplinks centered', () => {
19
21
  const { asFragment } = render(
20
22
  <JumpLinks isCentered>
21
- <JumpLinksItem>Inactive section</JumpLinksItem>
22
- <JumpLinksItem isActive>Active section</JumpLinksItem>
23
- <JumpLinksItem>Inactive section</JumpLinksItem>
23
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
24
+ <JumpLinksItem href="#" isActive>
25
+ Active section
26
+ </JumpLinksItem>
27
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
24
28
  </JumpLinks>
25
29
  );
26
30
  expect(asFragment()).toMatchSnapshot();
@@ -29,9 +33,11 @@ test('jumplinks centered', () => {
29
33
  test('jumplinks with label', () => {
30
34
  const { asFragment } = render(
31
35
  <JumpLinks isCentered label="Jump to section">
32
- <JumpLinksItem>Inactive section</JumpLinksItem>
33
- <JumpLinksItem isActive>Active section</JumpLinksItem>
34
- <JumpLinksItem>Inactive section</JumpLinksItem>
36
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
37
+ <JumpLinksItem href="#" isActive>
38
+ Active section
39
+ </JumpLinksItem>
40
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
35
41
  </JumpLinks>
36
42
  );
37
43
  expect(asFragment()).toMatchSnapshot();
@@ -40,9 +46,11 @@ test('jumplinks with label', () => {
40
46
  test('vertical with label', () => {
41
47
  const { asFragment } = render(
42
48
  <JumpLinks isVertical alwaysShowLabel label="Jump to section">
43
- <JumpLinksItem>Inactive section</JumpLinksItem>
44
- <JumpLinksItem isActive>Active section</JumpLinksItem>
45
- <JumpLinksItem>Inactive section</JumpLinksItem>
49
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
50
+ <JumpLinksItem href="#" isActive>
51
+ Active section
52
+ </JumpLinksItem>
53
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
46
54
  </JumpLinks>
47
55
  );
48
56
  expect(asFragment()).toMatchSnapshot();
@@ -51,17 +59,19 @@ test('vertical with label', () => {
51
59
  test('expandable vertical with subsection', () => {
52
60
  const { asFragment } = render(
53
61
  <JumpLinks isVertical label="Jump to section" expandable={{ default: 'expandable' }}>
54
- <JumpLinksItem>Inactive section</JumpLinksItem>
55
- <JumpLinksItem>
62
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
63
+ <JumpLinksItem href="#">
56
64
  Section with active subsection
57
65
  <JumpLinksList>
58
- <JumpLinksItem isActive>Active subsection</JumpLinksItem>
59
- <JumpLinksItem>Inactive subsection</JumpLinksItem>
60
- <JumpLinksItem>Inactive subsection</JumpLinksItem>
66
+ <JumpLinksItem href="#" isActive>
67
+ Active subsection
68
+ </JumpLinksItem>
69
+ <JumpLinksItem href="#">Inactive subsection</JumpLinksItem>
70
+ <JumpLinksItem href="#">Inactive subsection</JumpLinksItem>
61
71
  </JumpLinksList>
62
72
  </JumpLinksItem>
63
- <JumpLinksItem>Inactive section</JumpLinksItem>
64
- <JumpLinksItem>Inactive section</JumpLinksItem>
73
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
74
+ <JumpLinksItem href="#">Inactive section</JumpLinksItem>
65
75
  </JumpLinks>
66
76
  );
67
77
  expect(asFragment()).toMatchSnapshot();