@patternfly/react-core 4.161.1 → 4.162.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 (42) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/esm/components/DualListSelector/DualListSelectorControl.d.ts +1 -1
  3. package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.d.ts +1 -1
  4. package/dist/esm/components/DualListSelector/DualListSelectorListItem.d.ts +1 -1
  5. package/dist/esm/components/DualListSelector/DualListSelectorListWrapper.d.ts +1 -1
  6. package/dist/esm/components/Nav/Nav.d.ts +4 -0
  7. package/dist/esm/components/Nav/Nav.d.ts.map +1 -1
  8. package/dist/esm/components/Nav/Nav.js +5 -2
  9. package/dist/esm/components/Nav/Nav.js.map +1 -1
  10. package/dist/esm/components/Nav/NavItem.d.ts +4 -0
  11. package/dist/esm/components/Nav/NavItem.d.ts.map +1 -1
  12. package/dist/esm/components/Nav/NavItem.js +96 -6
  13. package/dist/esm/components/Nav/NavItem.js.map +1 -1
  14. package/dist/esm/components/Nav/NavList.d.ts +2 -0
  15. package/dist/esm/components/Nav/NavList.d.ts.map +1 -1
  16. package/dist/js/components/DualListSelector/DualListSelectorControl.d.ts +1 -1
  17. package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.d.ts +1 -1
  18. package/dist/js/components/DualListSelector/DualListSelectorListItem.d.ts +1 -1
  19. package/dist/js/components/DualListSelector/DualListSelectorListWrapper.d.ts +1 -1
  20. package/dist/js/components/Nav/Nav.d.ts +4 -0
  21. package/dist/js/components/Nav/Nav.d.ts.map +1 -1
  22. package/dist/js/components/Nav/Nav.js +5 -2
  23. package/dist/js/components/Nav/Nav.js.map +1 -1
  24. package/dist/js/components/Nav/NavItem.d.ts +4 -0
  25. package/dist/js/components/Nav/NavItem.d.ts.map +1 -1
  26. package/dist/js/components/Nav/NavItem.js +96 -6
  27. package/dist/js/components/Nav/NavItem.js.map +1 -1
  28. package/dist/js/components/Nav/NavList.d.ts +2 -0
  29. package/dist/js/components/Nav/NavList.d.ts.map +1 -1
  30. package/dist/umd/react-core.css +9093 -9048
  31. package/dist/umd/react-core.js +103 -8
  32. package/dist/umd/react-core.min.css +9357 -9313
  33. package/dist/umd/react-core.min.js +1 -1
  34. package/package.json +6 -6
  35. package/src/components/Nav/Nav.tsx +11 -3
  36. package/src/components/Nav/NavItem.tsx +124 -3
  37. package/src/components/Nav/__tests__/Generated/__snapshots__/Nav.test.tsx.snap +2 -0
  38. package/src/components/Nav/__tests__/Generated/__snapshots__/NavItem.test.tsx.snap +1 -0
  39. package/src/components/Nav/__tests__/__snapshots__/Nav.test.tsx.snap +49 -0
  40. package/src/components/Nav/examples/Nav.md +69 -0
  41. package/src/components/Nav/examples/nav.css +6 -1
  42. package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +15 -0
@@ -504,3 +504,72 @@ class NavTertiaryList extends React.Component {
504
504
  }
505
505
  ```
506
506
 
507
+ ### Flyout
508
+
509
+ A flyout should be a `Menu` component. Press `space` or `right arrow` to open a flyout using the keyboard, use the arrow keys to navigate between flyout items, and press `escape` or `left arrow` to close a flyout.
510
+
511
+ ```js
512
+ import React from 'react';
513
+ import {
514
+ Nav,
515
+ NavExpandable,
516
+ NavItem,
517
+ NavItemSeparator,
518
+ NavList,
519
+ NavGroup,
520
+ Menu,
521
+ MenuContent,
522
+ MenuList,
523
+ MenuItem
524
+ } from '@patternfly/react-core';
525
+
526
+ NavWithFlyout = () => {
527
+ const [activeItem, setActiveItem] = React.useState(0);
528
+ const onSelect = result => setActiveItem(result.itemId);
529
+ const onMenuSelect = (event, itemId) => setActiveItem(itemId);
530
+
531
+ const numFlyouts = 5;
532
+ const FlyoutMenu = ({ depth, children }) => (
533
+ <Menu key={depth} containsFlyout id={`menu-${depth}`} onSelect={onMenuSelect}>
534
+ <MenuContent>
535
+ <MenuList>
536
+ <MenuItem flyoutMenu={children} itemId={`next-menu-${depth}`} to={`#menu-link-${depth}`}>
537
+ Next menu
538
+ </MenuItem>
539
+ {[...Array(numFlyouts - depth).keys()].map(j => (
540
+ <MenuItem key={`${depth}-${j}`} itemId={`${depth}-${j}`} to={`#menu-link-${depth}-${j}`}>
541
+ Menu {depth} item {j}
542
+ </MenuItem>
543
+ ))}
544
+ <MenuItem flyoutMenu={children} itemId={`next-menu-2-${depth}`} to={`#second-menu-link-${depth}`}>
545
+ Next menu
546
+ </MenuItem>
547
+ </MenuList>
548
+ </MenuContent>
549
+ </Menu>
550
+ );
551
+ let curFlyout = <FlyoutMenu depth={1} />;
552
+ for (let i = 2; i < numFlyouts - 1; i++) {
553
+ curFlyout = <FlyoutMenu depth={i}>{curFlyout}</FlyoutMenu>;
554
+ }
555
+
556
+ return (
557
+ <Nav onSelect={onSelect}>
558
+ <NavList>
559
+ <NavItem id="default-link1" to="#default-link1" itemId={0} isActive={activeItem === 0}>
560
+ Link 1
561
+ </NavItem>
562
+ <NavItem id="default-link2" to="#default-link2" itemId={1} isActive={activeItem === 1}>
563
+ Link 2
564
+ </NavItem>
565
+ <NavItem flyout={curFlyout} id="default-link3" to="#default-link3" itemId={2} isActive={activeItem === 2}>
566
+ Link 3
567
+ </NavItem>
568
+ <NavItem id="default-link4" to="#default-link4" itemId={3} isActive={activeItem === 3}>
569
+ Link 4
570
+ </NavItem>
571
+ </NavList>
572
+ </Nav>
573
+ );
574
+ };
575
+ ```
@@ -4,6 +4,11 @@
4
4
  #ws-react-c-navigation-expandable,
5
5
  #ws-react-c-navigation-expandable-wsubnavigation-titles,
6
6
  #ws-react-c-navigation-mixed,
7
- #ws-react-c-navigation-horizontal-subnav {
7
+ #ws-react-c-navigation-horizontal-subnav,
8
+ #ws-react-c-navigation-flyout {
8
9
  background-color: var(--pf-global--BackgroundColor--dark-300);
9
10
  }
11
+
12
+ #ws-react-c-navigation-flyout {
13
+ width: 300px;
14
+ }
@@ -1092,6 +1092,7 @@ exports[`Check page to verify grouped nav and breadcrumb - new components syntax
1092
1092
  data-ouia-component-id="OUIA-Generated-NavItem-6"
1093
1093
  data-ouia-component-type="PF4/NavItem"
1094
1094
  data-ouia-safe={true}
1095
+ onMouseOver={[Function]}
1095
1096
  >
1096
1097
  <a
1097
1098
  aria-current="page"
@@ -1111,6 +1112,7 @@ exports[`Check page to verify grouped nav and breadcrumb - new components syntax
1111
1112
  data-ouia-component-id="OUIA-Generated-NavItem-7"
1112
1113
  data-ouia-component-type="PF4/NavItem"
1113
1114
  data-ouia-safe={true}
1115
+ onMouseOver={[Function]}
1114
1116
  >
1115
1117
  <a
1116
1118
  aria-current={null}
@@ -1130,6 +1132,7 @@ exports[`Check page to verify grouped nav and breadcrumb - new components syntax
1130
1132
  data-ouia-component-id="OUIA-Generated-NavItem-8"
1131
1133
  data-ouia-component-type="PF4/NavItem"
1132
1134
  data-ouia-safe={true}
1135
+ onMouseOver={[Function]}
1133
1136
  >
1134
1137
  <a
1135
1138
  aria-current={null}
@@ -1149,6 +1152,7 @@ exports[`Check page to verify grouped nav and breadcrumb - new components syntax
1149
1152
  data-ouia-component-id="OUIA-Generated-NavItem-9"
1150
1153
  data-ouia-component-type="PF4/NavItem"
1151
1154
  data-ouia-safe={true}
1155
+ onMouseOver={[Function]}
1152
1156
  >
1153
1157
  <a
1154
1158
  aria-current={null}
@@ -1168,6 +1172,7 @@ exports[`Check page to verify grouped nav and breadcrumb - new components syntax
1168
1172
  data-ouia-component-id="OUIA-Generated-NavItem-10"
1169
1173
  data-ouia-component-type="PF4/NavItem"
1170
1174
  data-ouia-safe={true}
1175
+ onMouseOver={[Function]}
1171
1176
  >
1172
1177
  <a
1173
1178
  aria-current={null}
@@ -1481,6 +1486,7 @@ exports[`Check page to verify grouped nav and breadcrumb - old / props syntax 1`
1481
1486
  data-ouia-component-id="OUIA-Generated-NavItem-11"
1482
1487
  data-ouia-component-type="PF4/NavItem"
1483
1488
  data-ouia-safe={true}
1489
+ onMouseOver={[Function]}
1484
1490
  >
1485
1491
  <a
1486
1492
  aria-current="page"
@@ -1500,6 +1506,7 @@ exports[`Check page to verify grouped nav and breadcrumb - old / props syntax 1`
1500
1506
  data-ouia-component-id="OUIA-Generated-NavItem-12"
1501
1507
  data-ouia-component-type="PF4/NavItem"
1502
1508
  data-ouia-safe={true}
1509
+ onMouseOver={[Function]}
1503
1510
  >
1504
1511
  <a
1505
1512
  aria-current={null}
@@ -1519,6 +1526,7 @@ exports[`Check page to verify grouped nav and breadcrumb - old / props syntax 1`
1519
1526
  data-ouia-component-id="OUIA-Generated-NavItem-13"
1520
1527
  data-ouia-component-type="PF4/NavItem"
1521
1528
  data-ouia-safe={true}
1529
+ onMouseOver={[Function]}
1522
1530
  >
1523
1531
  <a
1524
1532
  aria-current={null}
@@ -1538,6 +1546,7 @@ exports[`Check page to verify grouped nav and breadcrumb - old / props syntax 1`
1538
1546
  data-ouia-component-id="OUIA-Generated-NavItem-14"
1539
1547
  data-ouia-component-type="PF4/NavItem"
1540
1548
  data-ouia-safe={true}
1549
+ onMouseOver={[Function]}
1541
1550
  >
1542
1551
  <a
1543
1552
  aria-current={null}
@@ -1557,6 +1566,7 @@ exports[`Check page to verify grouped nav and breadcrumb - old / props syntax 1`
1557
1566
  data-ouia-component-id="OUIA-Generated-NavItem-15"
1558
1567
  data-ouia-component-type="PF4/NavItem"
1559
1568
  data-ouia-safe={true}
1569
+ onMouseOver={[Function]}
1560
1570
  >
1561
1571
  <a
1562
1572
  aria-current={null}
@@ -1956,6 +1966,7 @@ exports[`Check page to verify nav is created - PageNavigation syntax 1`] = `
1956
1966
  data-ouia-component-id="OUIA-Generated-NavItem-1"
1957
1967
  data-ouia-component-type="PF4/NavItem"
1958
1968
  data-ouia-safe={true}
1969
+ onMouseOver={[Function]}
1959
1970
  >
1960
1971
  <a
1961
1972
  aria-current="page"
@@ -1975,6 +1986,7 @@ exports[`Check page to verify nav is created - PageNavigation syntax 1`] = `
1975
1986
  data-ouia-component-id="OUIA-Generated-NavItem-2"
1976
1987
  data-ouia-component-type="PF4/NavItem"
1977
1988
  data-ouia-safe={true}
1989
+ onMouseOver={[Function]}
1978
1990
  >
1979
1991
  <a
1980
1992
  aria-current={null}
@@ -1994,6 +2006,7 @@ exports[`Check page to verify nav is created - PageNavigation syntax 1`] = `
1994
2006
  data-ouia-component-id="OUIA-Generated-NavItem-3"
1995
2007
  data-ouia-component-type="PF4/NavItem"
1996
2008
  data-ouia-safe={true}
2009
+ onMouseOver={[Function]}
1997
2010
  >
1998
2011
  <a
1999
2012
  aria-current={null}
@@ -2013,6 +2026,7 @@ exports[`Check page to verify nav is created - PageNavigation syntax 1`] = `
2013
2026
  data-ouia-component-id="OUIA-Generated-NavItem-4"
2014
2027
  data-ouia-component-type="PF4/NavItem"
2015
2028
  data-ouia-safe={true}
2029
+ onMouseOver={[Function]}
2016
2030
  >
2017
2031
  <a
2018
2032
  aria-current={null}
@@ -2032,6 +2046,7 @@ exports[`Check page to verify nav is created - PageNavigation syntax 1`] = `
2032
2046
  data-ouia-component-id="OUIA-Generated-NavItem-5"
2033
2047
  data-ouia-component-type="PF4/NavItem"
2034
2048
  data-ouia-safe={true}
2049
+ onMouseOver={[Function]}
2035
2050
  >
2036
2051
  <a
2037
2052
  aria-current={null}