@patternfly/react-core 4.203.0 → 4.204.0
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 +27 -0
- package/dist/esm/components/Form/Form.d.ts +3 -1
- package/dist/esm/components/Form/Form.d.ts.map +1 -1
- package/dist/esm/components/Form/Form.js +4 -2
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts +4 -2
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +2 -2
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.d.ts +10 -6
- package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.js +10 -4
- package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts +7 -3
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +5 -4
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +12 -8
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js +6 -5
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts +3 -5
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.js +6 -6
- package/dist/esm/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/esm/components/Switch/Switch.d.ts +7 -5
- package/dist/esm/components/Switch/Switch.d.ts.map +1 -1
- package/dist/esm/components/Switch/Switch.js +3 -1
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/js/components/Form/Form.d.ts +3 -1
- package/dist/js/components/Form/Form.d.ts.map +1 -1
- package/dist/js/components/Form/Form.js +4 -2
- package/dist/js/components/Form/Form.js.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts +4 -2
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +2 -2
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.d.ts +10 -6
- package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.js +10 -4
- package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts +7 -3
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.js +5 -4
- package/dist/js/components/Pagination/Pagination.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +12 -8
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js +6 -5
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts +3 -5
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.js +7 -6
- package/dist/js/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/js/components/Switch/Switch.d.ts +7 -5
- package/dist/js/components/Switch/Switch.d.ts.map +1 -1
- package/dist/js/components/Switch/Switch.js +3 -1
- package/dist/js/components/Switch/Switch.js.map +1 -1
- package/dist/umd/react-core.css +171 -83
- package/dist/umd/react-core.js +41 -24
- package/dist/umd/react-core.min.css +102 -14
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Form/Form.tsx +11 -2
- package/src/components/MultipleFileUpload/MultipleFileUploadStatusItem.tsx +6 -2
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUpload.test.tsx +8 -8
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadButton.test.tsx +7 -7
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadInfo.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadMain.test.tsx +11 -11
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatus.test.tsx +11 -9
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatusItem.test.tsx +28 -13
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitle.test.tsx +11 -11
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleIcon.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleText.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleTextSeparator.test.tsx +7 -5
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUpload.test.tsx.snap +42 -124
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadButton.test.tsx.snap +36 -86
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadInfo.test.tsx.snap +6 -8
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadMain.test.tsx.snap +85 -179
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatus.test.tsx.snap +188 -383
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatusItem.test.tsx.snap +596 -330
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitle.test.tsx.snap +32 -49
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleIcon.test.tsx.snap +9 -11
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleText.test.tsx.snap +6 -8
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleTextSeparator.test.tsx.snap +6 -8
- package/src/components/Pagination/OptionsToggle.tsx +56 -46
- package/src/components/Pagination/Pagination.tsx +12 -5
- package/src/components/Pagination/PaginationOptionsMenu.tsx +20 -12
- package/src/components/Pagination/__tests__/Generated/__snapshots__/OptionsToggle.test.tsx.snap +1 -0
- package/src/components/Pagination/__tests__/Pagination.test.tsx +6 -4
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +223 -0
- package/src/components/Pagination/examples/Pagination.md +11 -1
- package/src/components/ProgressStepper/ProgressStep.tsx +10 -15
- package/src/components/ProgressStepper/__tests__/ProgressStepper.test.tsx +1 -1
- package/src/components/ProgressStepper/examples/ProgressStepper.md +13 -20
- package/src/components/Switch/Switch.tsx +13 -5
- package/src/components/Switch/examples/Switch.md +64 -5
- package/src/components/TimePicker/__tests__/TimePicker.test.tsx +1 -1
- package/src/components/Toolbar/examples/Toolbar.md +7 -39
- package/src/components/Dropdown/__tests__/Generated/InternalDropdownItem.test.tsx +0 -42
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/InternalDropdownItem.test.tsx.snap +0 -10
- package/src/components/Select/__tests__/Generated/SelectGroup.test.tsx +0 -25
- package/src/components/Select/__tests__/Generated/SelectMenu.test.tsx +0 -25
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectGroup.test.tsx.snap +0 -18
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectMenu.test.tsx.snap +0 -10
- package/src/components/Toolbar/__tests__/Generated/ToolbarToggleGroup.test.tsx +0 -27
- package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarToggleGroup.test.tsx.snap +0 -29
|
@@ -30,6 +30,7 @@ exports[`Pagination component render custom pagination toggle 1`] = `
|
|
|
30
30
|
</span>
|
|
31
31
|
<button
|
|
32
32
|
aria-expanded="false"
|
|
33
|
+
aria-haspopup="listbox"
|
|
33
34
|
aria-label="Items per page"
|
|
34
35
|
class=" pf-c-options-menu__toggle-button"
|
|
35
36
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-13"
|
|
@@ -242,6 +243,7 @@ exports[`Pagination component render custom perPageOptions 1`] = `
|
|
|
242
243
|
</span>
|
|
243
244
|
<button
|
|
244
245
|
aria-expanded="false"
|
|
246
|
+
aria-haspopup="listbox"
|
|
245
247
|
aria-label="Items per page"
|
|
246
248
|
class=" pf-c-options-menu__toggle-button"
|
|
247
249
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-10"
|
|
@@ -454,6 +456,7 @@ exports[`Pagination component render custom start end 1`] = `
|
|
|
454
456
|
</span>
|
|
455
457
|
<button
|
|
456
458
|
aria-expanded="false"
|
|
459
|
+
aria-haspopup="listbox"
|
|
457
460
|
aria-label="Items per page"
|
|
458
461
|
class=" pf-c-options-menu__toggle-button"
|
|
459
462
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-11"
|
|
@@ -835,6 +838,7 @@ exports[`Pagination component render last page 1`] = `
|
|
|
835
838
|
</span>
|
|
836
839
|
<button
|
|
837
840
|
aria-expanded="false"
|
|
841
|
+
aria-haspopup="listbox"
|
|
838
842
|
aria-label="Items per page"
|
|
839
843
|
class=" pf-c-options-menu__toggle-button"
|
|
840
844
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-9"
|
|
@@ -1047,6 +1051,7 @@ exports[`Pagination component render limited number of pages 1`] = `
|
|
|
1047
1051
|
</span>
|
|
1048
1052
|
<button
|
|
1049
1053
|
aria-expanded="false"
|
|
1054
|
+
aria-haspopup="listbox"
|
|
1050
1055
|
aria-label="Items per page"
|
|
1051
1056
|
class=" pf-c-options-menu__toggle-button"
|
|
1052
1057
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-7"
|
|
@@ -1250,6 +1255,7 @@ exports[`Pagination component render should render correctly bottom 1`] = `
|
|
|
1250
1255
|
</span>
|
|
1251
1256
|
<button
|
|
1252
1257
|
aria-expanded="false"
|
|
1258
|
+
aria-haspopup="listbox"
|
|
1253
1259
|
aria-label="Items per page"
|
|
1254
1260
|
class=" pf-c-options-menu__toggle-button"
|
|
1255
1261
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-2"
|
|
@@ -1450,6 +1456,7 @@ exports[`Pagination component render should render correctly bottom sticky 1`] =
|
|
|
1450
1456
|
</span>
|
|
1451
1457
|
<button
|
|
1452
1458
|
aria-expanded="false"
|
|
1459
|
+
aria-haspopup="listbox"
|
|
1453
1460
|
aria-label="Items per page"
|
|
1454
1461
|
class=" pf-c-options-menu__toggle-button"
|
|
1455
1462
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-5"
|
|
@@ -1618,6 +1625,215 @@ exports[`Pagination component render should render correctly bottom sticky 1`] =
|
|
|
1618
1625
|
</DocumentFragment>
|
|
1619
1626
|
`;
|
|
1620
1627
|
|
|
1628
|
+
exports[`Pagination component render should render correctly button variant 1`] = `
|
|
1629
|
+
<DocumentFragment>
|
|
1630
|
+
<div
|
|
1631
|
+
class="pf-c-pagination"
|
|
1632
|
+
data-ouia-component-id="OUIA-Generated-Pagination-top-17"
|
|
1633
|
+
data-ouia-component-type="PF4/Pagination"
|
|
1634
|
+
data-ouia-safe="true"
|
|
1635
|
+
id="pagination-options-menu-18"
|
|
1636
|
+
style="--pf-c-pagination__nav-page-select--c-form-control--width-chars: 2;"
|
|
1637
|
+
>
|
|
1638
|
+
<div
|
|
1639
|
+
class="pf-c-pagination__total-items"
|
|
1640
|
+
>
|
|
1641
|
+
<b>
|
|
1642
|
+
-9 - 10
|
|
1643
|
+
</b>
|
|
1644
|
+
of
|
|
1645
|
+
<b>
|
|
1646
|
+
20
|
|
1647
|
+
</b>
|
|
1648
|
+
|
|
1649
|
+
</div>
|
|
1650
|
+
<div
|
|
1651
|
+
class="pf-c-options-menu"
|
|
1652
|
+
data-ouia-component-type="PF4/PaginationOptionsMenu"
|
|
1653
|
+
data-ouia-safe="true"
|
|
1654
|
+
>
|
|
1655
|
+
<button
|
|
1656
|
+
aria-expanded="false"
|
|
1657
|
+
aria-haspopup="listbox"
|
|
1658
|
+
aria-label=""
|
|
1659
|
+
class=" pf-c-options-menu__toggle pf-m-plain pf-m-text"
|
|
1660
|
+
data-ouia-component-id="OUIA-Generated-DropdownToggle-18"
|
|
1661
|
+
data-ouia-component-type="PF4/DropdownToggle"
|
|
1662
|
+
data-ouia-safe="true"
|
|
1663
|
+
id="pagination-options-menu-toggle-17"
|
|
1664
|
+
type="button"
|
|
1665
|
+
>
|
|
1666
|
+
<span
|
|
1667
|
+
class="pf-c-options-menu__toggle-text"
|
|
1668
|
+
>
|
|
1669
|
+
<b>
|
|
1670
|
+
-9 - 10
|
|
1671
|
+
</b>
|
|
1672
|
+
of
|
|
1673
|
+
<b>
|
|
1674
|
+
20
|
|
1675
|
+
</b>
|
|
1676
|
+
|
|
1677
|
+
</span>
|
|
1678
|
+
<span
|
|
1679
|
+
class="pf-c-options-menu__toggle-icon"
|
|
1680
|
+
>
|
|
1681
|
+
<svg
|
|
1682
|
+
aria-hidden="true"
|
|
1683
|
+
fill="currentColor"
|
|
1684
|
+
height="1em"
|
|
1685
|
+
role="img"
|
|
1686
|
+
style="vertical-align: -0.125em;"
|
|
1687
|
+
viewBox="0 0 320 512"
|
|
1688
|
+
width="1em"
|
|
1689
|
+
>
|
|
1690
|
+
<path
|
|
1691
|
+
d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"
|
|
1692
|
+
/>
|
|
1693
|
+
</svg>
|
|
1694
|
+
</span>
|
|
1695
|
+
</button>
|
|
1696
|
+
</div>
|
|
1697
|
+
<nav
|
|
1698
|
+
aria-label="Pagination"
|
|
1699
|
+
class="pf-c-pagination__nav"
|
|
1700
|
+
>
|
|
1701
|
+
<div
|
|
1702
|
+
class="pf-c-pagination__nav-control pf-m-first"
|
|
1703
|
+
>
|
|
1704
|
+
<button
|
|
1705
|
+
aria-disabled="true"
|
|
1706
|
+
aria-label="Go to first page"
|
|
1707
|
+
class="pf-c-button pf-m-plain pf-m-disabled"
|
|
1708
|
+
data-action="first"
|
|
1709
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-71"
|
|
1710
|
+
data-ouia-component-type="PF4/Button"
|
|
1711
|
+
data-ouia-safe="true"
|
|
1712
|
+
disabled=""
|
|
1713
|
+
type="button"
|
|
1714
|
+
>
|
|
1715
|
+
<svg
|
|
1716
|
+
aria-hidden="true"
|
|
1717
|
+
fill="currentColor"
|
|
1718
|
+
height="1em"
|
|
1719
|
+
role="img"
|
|
1720
|
+
style="vertical-align: -0.125em;"
|
|
1721
|
+
viewBox="0 0 448 512"
|
|
1722
|
+
width="1em"
|
|
1723
|
+
>
|
|
1724
|
+
<path
|
|
1725
|
+
d="M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z"
|
|
1726
|
+
/>
|
|
1727
|
+
</svg>
|
|
1728
|
+
</button>
|
|
1729
|
+
</div>
|
|
1730
|
+
<div
|
|
1731
|
+
class="pf-c-pagination__nav-control"
|
|
1732
|
+
>
|
|
1733
|
+
<button
|
|
1734
|
+
aria-disabled="true"
|
|
1735
|
+
aria-label="Go to previous page"
|
|
1736
|
+
class="pf-c-button pf-m-plain pf-m-disabled"
|
|
1737
|
+
data-action="previous"
|
|
1738
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-72"
|
|
1739
|
+
data-ouia-component-type="PF4/Button"
|
|
1740
|
+
data-ouia-safe="true"
|
|
1741
|
+
disabled=""
|
|
1742
|
+
type="button"
|
|
1743
|
+
>
|
|
1744
|
+
<svg
|
|
1745
|
+
aria-hidden="true"
|
|
1746
|
+
fill="currentColor"
|
|
1747
|
+
height="1em"
|
|
1748
|
+
role="img"
|
|
1749
|
+
style="vertical-align: -0.125em;"
|
|
1750
|
+
viewBox="0 0 256 512"
|
|
1751
|
+
width="1em"
|
|
1752
|
+
>
|
|
1753
|
+
<path
|
|
1754
|
+
d="M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"
|
|
1755
|
+
/>
|
|
1756
|
+
</svg>
|
|
1757
|
+
</button>
|
|
1758
|
+
</div>
|
|
1759
|
+
<div
|
|
1760
|
+
class="pf-c-pagination__nav-page-select"
|
|
1761
|
+
>
|
|
1762
|
+
<input
|
|
1763
|
+
aria-label="Current page"
|
|
1764
|
+
class="pf-c-form-control"
|
|
1765
|
+
max="2"
|
|
1766
|
+
min="1"
|
|
1767
|
+
type="number"
|
|
1768
|
+
value="1"
|
|
1769
|
+
/>
|
|
1770
|
+
<span
|
|
1771
|
+
aria-hidden="true"
|
|
1772
|
+
>
|
|
1773
|
+
of 2
|
|
1774
|
+
</span>
|
|
1775
|
+
</div>
|
|
1776
|
+
<div
|
|
1777
|
+
class="pf-c-pagination__nav-control"
|
|
1778
|
+
>
|
|
1779
|
+
<button
|
|
1780
|
+
aria-disabled="false"
|
|
1781
|
+
aria-label="Go to next page"
|
|
1782
|
+
class="pf-c-button pf-m-plain"
|
|
1783
|
+
data-action="next"
|
|
1784
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-73"
|
|
1785
|
+
data-ouia-component-type="PF4/Button"
|
|
1786
|
+
data-ouia-safe="true"
|
|
1787
|
+
type="button"
|
|
1788
|
+
>
|
|
1789
|
+
<svg
|
|
1790
|
+
aria-hidden="true"
|
|
1791
|
+
fill="currentColor"
|
|
1792
|
+
height="1em"
|
|
1793
|
+
role="img"
|
|
1794
|
+
style="vertical-align: -0.125em;"
|
|
1795
|
+
viewBox="0 0 256 512"
|
|
1796
|
+
width="1em"
|
|
1797
|
+
>
|
|
1798
|
+
<path
|
|
1799
|
+
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"
|
|
1800
|
+
/>
|
|
1801
|
+
</svg>
|
|
1802
|
+
</button>
|
|
1803
|
+
</div>
|
|
1804
|
+
<div
|
|
1805
|
+
class="pf-c-pagination__nav-control pf-m-last"
|
|
1806
|
+
>
|
|
1807
|
+
<button
|
|
1808
|
+
aria-disabled="false"
|
|
1809
|
+
aria-label="Go to last page"
|
|
1810
|
+
class="pf-c-button pf-m-plain"
|
|
1811
|
+
data-action="last"
|
|
1812
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-74"
|
|
1813
|
+
data-ouia-component-type="PF4/Button"
|
|
1814
|
+
data-ouia-safe="true"
|
|
1815
|
+
type="button"
|
|
1816
|
+
>
|
|
1817
|
+
<svg
|
|
1818
|
+
aria-hidden="true"
|
|
1819
|
+
fill="currentColor"
|
|
1820
|
+
height="1em"
|
|
1821
|
+
role="img"
|
|
1822
|
+
style="vertical-align: -0.125em;"
|
|
1823
|
+
viewBox="0 0 448 512"
|
|
1824
|
+
width="1em"
|
|
1825
|
+
>
|
|
1826
|
+
<path
|
|
1827
|
+
d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"
|
|
1828
|
+
/>
|
|
1829
|
+
</svg>
|
|
1830
|
+
</button>
|
|
1831
|
+
</div>
|
|
1832
|
+
</nav>
|
|
1833
|
+
</div>
|
|
1834
|
+
</DocumentFragment>
|
|
1835
|
+
`;
|
|
1836
|
+
|
|
1621
1837
|
exports[`Pagination component render should render correctly compact 1`] = `
|
|
1622
1838
|
<DocumentFragment>
|
|
1623
1839
|
<div
|
|
@@ -1662,6 +1878,7 @@ exports[`Pagination component render should render correctly compact 1`] = `
|
|
|
1662
1878
|
</span>
|
|
1663
1879
|
<button
|
|
1664
1880
|
aria-expanded="false"
|
|
1881
|
+
aria-haspopup="listbox"
|
|
1665
1882
|
aria-label="Items per page"
|
|
1666
1883
|
class=" pf-c-options-menu__toggle-button"
|
|
1667
1884
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-3"
|
|
@@ -1800,6 +2017,7 @@ exports[`Pagination component render should render correctly disabled 1`] = `
|
|
|
1800
2017
|
</span>
|
|
1801
2018
|
<button
|
|
1802
2019
|
aria-expanded="false"
|
|
2020
|
+
aria-haspopup="listbox"
|
|
1803
2021
|
aria-label="Items per page"
|
|
1804
2022
|
class=" pf-c-options-menu__toggle-button"
|
|
1805
2023
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-6"
|
|
@@ -2016,6 +2234,7 @@ exports[`Pagination component render should render correctly sticky 1`] = `
|
|
|
2016
2234
|
</span>
|
|
2017
2235
|
<button
|
|
2018
2236
|
aria-expanded="false"
|
|
2237
|
+
aria-haspopup="listbox"
|
|
2019
2238
|
aria-label="Items per page"
|
|
2020
2239
|
class=" pf-c-options-menu__toggle-button"
|
|
2021
2240
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-4"
|
|
@@ -2228,6 +2447,7 @@ exports[`Pagination component render should render correctly top 1`] = `
|
|
|
2228
2447
|
</span>
|
|
2229
2448
|
<button
|
|
2230
2449
|
aria-expanded="false"
|
|
2450
|
+
aria-haspopup="listbox"
|
|
2231
2451
|
aria-label="Items per page"
|
|
2232
2452
|
class=" pf-c-options-menu__toggle-button"
|
|
2233
2453
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-1"
|
|
@@ -2440,6 +2660,7 @@ exports[`Pagination component render titles 1`] = `
|
|
|
2440
2660
|
</span>
|
|
2441
2661
|
<button
|
|
2442
2662
|
aria-expanded="false"
|
|
2663
|
+
aria-haspopup="listbox"
|
|
2443
2664
|
aria-label="Items per page"
|
|
2444
2665
|
class=" pf-c-options-menu__toggle-button"
|
|
2445
2666
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-12"
|
|
@@ -2652,6 +2873,7 @@ exports[`Pagination component render up drop direction 1`] = `
|
|
|
2652
2873
|
</span>
|
|
2653
2874
|
<button
|
|
2654
2875
|
aria-expanded="false"
|
|
2876
|
+
aria-haspopup="listbox"
|
|
2655
2877
|
aria-label="Items per page"
|
|
2656
2878
|
class=" pf-c-options-menu__toggle-button"
|
|
2657
2879
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-14"
|
|
@@ -2864,6 +3086,7 @@ exports[`Pagination component render zero results 1`] = `
|
|
|
2864
3086
|
</span>
|
|
2865
3087
|
<button
|
|
2866
3088
|
aria-expanded="false"
|
|
3089
|
+
aria-haspopup="listbox"
|
|
2867
3090
|
aria-label="Items per page"
|
|
2868
3091
|
class=" pf-c-options-menu__toggle-button"
|
|
2869
3092
|
data-ouia-component-id="OUIA-Generated-DropdownToggle-8"
|
|
@@ -38,6 +38,7 @@ class PaginationTop extends React.Component {
|
|
|
38
38
|
render() {
|
|
39
39
|
return (
|
|
40
40
|
<Pagination
|
|
41
|
+
perPageComponent="button"
|
|
41
42
|
itemCount={523}
|
|
42
43
|
perPage={this.state.perPage}
|
|
43
44
|
page={this.state.page}
|
|
@@ -77,6 +78,7 @@ class PaginationBottom extends React.Component {
|
|
|
77
78
|
render() {
|
|
78
79
|
return (
|
|
79
80
|
<Pagination
|
|
81
|
+
perPageComponent="button"
|
|
80
82
|
itemCount={333}
|
|
81
83
|
widgetId="pagination-options-menu-bottom"
|
|
82
84
|
perPage={this.state.perPage}
|
|
@@ -89,6 +91,7 @@ class PaginationBottom extends React.Component {
|
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
```
|
|
94
|
+
|
|
92
95
|
### Indeterminate
|
|
93
96
|
|
|
94
97
|
By not passing `itemCount` and passing `toggleTemplate` you can customize the toggle with text.
|
|
@@ -106,6 +109,7 @@ PaginationIndeterminate = () => {
|
|
|
106
109
|
|
|
107
110
|
return (
|
|
108
111
|
<Pagination
|
|
112
|
+
perPageComponent="button"
|
|
109
113
|
toggleTemplate={({ firstIndex, lastIndex }) => (
|
|
110
114
|
<React.Fragment>
|
|
111
115
|
<b>
|
|
@@ -122,7 +126,7 @@ PaginationIndeterminate = () => {
|
|
|
122
126
|
onPerPageSelect={onPerPageSelect}
|
|
123
127
|
/>
|
|
124
128
|
);
|
|
125
|
-
}
|
|
129
|
+
};
|
|
126
130
|
```
|
|
127
131
|
|
|
128
132
|
### Disabled
|
|
@@ -155,6 +159,7 @@ class PaginationDisabled extends React.Component {
|
|
|
155
159
|
render() {
|
|
156
160
|
return (
|
|
157
161
|
<Pagination
|
|
162
|
+
perPageComponent="button"
|
|
158
163
|
itemCount={523}
|
|
159
164
|
perPage={this.state.perPage}
|
|
160
165
|
page={this.state.page}
|
|
@@ -198,6 +203,7 @@ class PaginationTop extends React.Component {
|
|
|
198
203
|
render() {
|
|
199
204
|
return (
|
|
200
205
|
<Pagination
|
|
206
|
+
perPageComponent="button"
|
|
201
207
|
itemCount={0}
|
|
202
208
|
perPage={this.state.perPage}
|
|
203
209
|
page={this.state.page}
|
|
@@ -240,6 +246,7 @@ class PaginationTop extends React.Component {
|
|
|
240
246
|
render() {
|
|
241
247
|
return (
|
|
242
248
|
<Pagination
|
|
249
|
+
perPageComponent="button"
|
|
243
250
|
itemCount={15}
|
|
244
251
|
perPage={this.state.perPage}
|
|
245
252
|
page={this.state.page}
|
|
@@ -282,6 +289,7 @@ class PaginationTop extends React.Component {
|
|
|
282
289
|
render() {
|
|
283
290
|
return (
|
|
284
291
|
<Pagination
|
|
292
|
+
perPageComponent="button"
|
|
285
293
|
itemCount={523}
|
|
286
294
|
perPage={this.state.perPage}
|
|
287
295
|
page={this.state.page}
|
|
@@ -335,6 +343,7 @@ class PaginationSticky extends React.Component {
|
|
|
335
343
|
{this.state.isTopSticky && (
|
|
336
344
|
<React.Fragment>
|
|
337
345
|
<Pagination
|
|
346
|
+
perPageComponent="button"
|
|
338
347
|
itemCount={523}
|
|
339
348
|
perPage={this.state.perPage}
|
|
340
349
|
page={this.state.page}
|
|
@@ -368,6 +377,7 @@ class PaginationSticky extends React.Component {
|
|
|
368
377
|
))}
|
|
369
378
|
</Gallery>
|
|
370
379
|
<Pagination
|
|
380
|
+
perPageComponent="button"
|
|
371
381
|
itemCount={523}
|
|
372
382
|
perPage={this.state.perPage}
|
|
373
383
|
page={this.state.page}
|
|
@@ -22,13 +22,11 @@ export interface ProgressStepProps
|
|
|
22
22
|
description?: string;
|
|
23
23
|
/** ID of the title of the progress step. */
|
|
24
24
|
titleId?: string;
|
|
25
|
-
/** Popover for a progress step. */
|
|
26
|
-
popover?: React.ReactNode;
|
|
27
|
-
/** @hide Forwarded reference to title container */
|
|
28
|
-
innerRef?: React.Ref<any>;
|
|
29
25
|
/** Accessible label for the progress step. Should communicate all information being communicated by the progress
|
|
30
26
|
* step's icon, including the variant and the completed status. */
|
|
31
27
|
'aria-label'?: string;
|
|
28
|
+
/** Forwards the step ref to rendered function. Use this prop to add a popover to the step.*/
|
|
29
|
+
popoverRender?: (stepRef: React.RefObject<any>) => React.ReactNode;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
const variantIcons = {
|
|
@@ -49,7 +47,7 @@ const variantStyle = {
|
|
|
49
47
|
danger: styles.modifiers.danger
|
|
50
48
|
};
|
|
51
49
|
|
|
52
|
-
const
|
|
50
|
+
export const ProgressStep: React.FunctionComponent<ProgressStepProps> = ({
|
|
53
51
|
children,
|
|
54
52
|
className,
|
|
55
53
|
variant,
|
|
@@ -57,13 +55,13 @@ const ProgressStepBase: React.FunctionComponent<ProgressStepProps> = ({
|
|
|
57
55
|
description,
|
|
58
56
|
icon,
|
|
59
57
|
titleId,
|
|
60
|
-
popover,
|
|
61
|
-
innerRef,
|
|
62
58
|
'aria-label': ariaLabel,
|
|
59
|
+
popoverRender,
|
|
63
60
|
...props
|
|
64
61
|
}: ProgressStepProps) => {
|
|
65
62
|
const _icon = icon !== undefined ? icon : variantIcons[variant];
|
|
66
|
-
const Component =
|
|
63
|
+
const Component = popoverRender !== undefined ? 'span' : 'div';
|
|
64
|
+
const stepRef = React.useRef();
|
|
67
65
|
|
|
68
66
|
if (props.id === undefined || titleId === undefined) {
|
|
69
67
|
/* eslint-disable no-console */
|
|
@@ -89,14 +87,14 @@ const ProgressStepBase: React.FunctionComponent<ProgressStepProps> = ({
|
|
|
89
87
|
</div>
|
|
90
88
|
<div className={css(styles.progressStepperStepMain)}>
|
|
91
89
|
<Component
|
|
92
|
-
className={css(styles.progressStepperStepTitle,
|
|
90
|
+
className={css(styles.progressStepperStepTitle, popoverRender && styles.modifiers.helpText)}
|
|
93
91
|
id={titleId}
|
|
94
|
-
ref={
|
|
95
|
-
{...(
|
|
92
|
+
ref={stepRef}
|
|
93
|
+
{...(popoverRender && { tabIndex: 0, role: 'button', type: 'button' })}
|
|
96
94
|
{...(props.id !== undefined && titleId !== undefined && { 'aria-labelledby': `${props.id} ${titleId}` })}
|
|
97
95
|
>
|
|
98
96
|
{children}
|
|
99
|
-
{
|
|
97
|
+
{popoverRender && popoverRender(stepRef)}
|
|
100
98
|
</Component>
|
|
101
99
|
{description && <div className={css(styles.progressStepperStepDescription)}>{description}</div>}
|
|
102
100
|
</div>
|
|
@@ -104,7 +102,4 @@ const ProgressStepBase: React.FunctionComponent<ProgressStepProps> = ({
|
|
|
104
102
|
);
|
|
105
103
|
};
|
|
106
104
|
|
|
107
|
-
export const ProgressStep = React.forwardRef((props: ProgressStepProps, ref: React.Ref<HTMLSpanElement>) => (
|
|
108
|
-
<ProgressStepBase innerRef={ref} {...props} />
|
|
109
|
-
));
|
|
110
105
|
ProgressStep.displayName = 'ProgressStep';
|
|
@@ -87,7 +87,7 @@ describe('ProgressStep', () => {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
test('renders help text styling', () => {
|
|
90
|
-
const view = render(<ProgressStep
|
|
90
|
+
const view = render(<ProgressStep popoverRender={({ stepRef }) => (<div></div>)}>Title</ProgressStep>);
|
|
91
91
|
expect(view.container).toMatchSnapshot();
|
|
92
92
|
});
|
|
93
93
|
|
|
@@ -331,17 +331,13 @@ import PendingIcon from '@patternfly/react-icons/dist/esm/icons/pending-icon';
|
|
|
331
331
|
|
|
332
332
|
### With help popover
|
|
333
333
|
|
|
334
|
-
To add a popover to a progress step, set the `
|
|
334
|
+
To add a popover to a progress step, set the `popoverRender` properties on the `ProgressStep` component.
|
|
335
335
|
|
|
336
336
|
```js
|
|
337
337
|
import React from 'react';
|
|
338
338
|
import { ProgressStepper, ProgressStep, Popover } from '@patternfly/react-core';
|
|
339
339
|
|
|
340
340
|
PopoverProgressStep = () => {
|
|
341
|
-
const firstStepRef = React.useRef();
|
|
342
|
-
const secondStepRef = React.useRef();
|
|
343
|
-
const thirdStepRef = React.useRef();
|
|
344
|
-
|
|
345
341
|
return (
|
|
346
342
|
<ProgressStepper>
|
|
347
343
|
<ProgressStep
|
|
@@ -349,55 +345,52 @@ PopoverProgressStep = () => {
|
|
|
349
345
|
id="popover-step1"
|
|
350
346
|
titleId="popover-step1-title"
|
|
351
347
|
aria-label="completed step with popover, step with success"
|
|
352
|
-
|
|
348
|
+
popoverRender={( stepRef ) => (
|
|
353
349
|
<Popover
|
|
354
350
|
aria-label="First step help"
|
|
355
351
|
headerContent={<div>First step popover</div>}
|
|
356
352
|
bodyContent={<div>Additional info or help text content.</div>}
|
|
357
|
-
reference={
|
|
353
|
+
reference={stepRef}
|
|
358
354
|
position="right"
|
|
359
355
|
/>
|
|
360
|
-
|
|
361
|
-
ref={firstStepRef}
|
|
356
|
+
)}
|
|
362
357
|
>
|
|
363
|
-
First
|
|
358
|
+
First step
|
|
364
359
|
</ProgressStep>
|
|
365
360
|
<ProgressStep
|
|
366
361
|
variant="danger"
|
|
367
362
|
id="popover-step2"
|
|
368
363
|
titleId="popover-step2-title"
|
|
369
364
|
aria-label="completed step with popover, step with danger"
|
|
370
|
-
|
|
365
|
+
popoverRender={( stepRef ) => (
|
|
371
366
|
<Popover
|
|
372
367
|
aria-label="Second step help"
|
|
373
368
|
headerContent={<div>Second step popover</div>}
|
|
374
369
|
bodyContent={<div>Additional info or help text content.</div>}
|
|
375
|
-
reference={
|
|
370
|
+
reference={stepRef}
|
|
376
371
|
position="right"
|
|
377
372
|
/>
|
|
378
|
-
}
|
|
379
|
-
ref={secondStepRef}
|
|
373
|
+
)}
|
|
380
374
|
>
|
|
381
|
-
Second
|
|
375
|
+
Second step
|
|
382
376
|
</ProgressStep>
|
|
383
377
|
<ProgressStep
|
|
384
378
|
variant="info"
|
|
385
379
|
id="popover-step3"
|
|
386
380
|
titleId="popover-step3-title"
|
|
387
381
|
aria-label="step with popover"
|
|
388
|
-
|
|
382
|
+
popoverRender={(stepRef) => (
|
|
389
383
|
<Popover
|
|
390
384
|
aria-label="Third step help"
|
|
391
385
|
headerContent={<div>Third step popover</div>}
|
|
392
386
|
bodyContent={<div>Additional info or help text content.</div>}
|
|
393
|
-
reference={
|
|
387
|
+
reference={stepRef}
|
|
394
388
|
position="right"
|
|
395
389
|
/>
|
|
396
|
-
}
|
|
390
|
+
)}
|
|
397
391
|
isCurrent
|
|
398
|
-
ref={thirdStepRef}
|
|
399
392
|
>
|
|
400
|
-
Third
|
|
393
|
+
Third step
|
|
401
394
|
</ProgressStep>
|
|
402
395
|
<ProgressStep variant="pending" id="popover-step4" titleId="popover-step4-title" aria-label="pending step">
|
|
403
396
|
Fourth step
|
|
@@ -10,19 +10,21 @@ export interface SwitchProps
|
|
|
10
10
|
OUIAProps {
|
|
11
11
|
/** id for the label. */
|
|
12
12
|
id?: string;
|
|
13
|
-
/** Additional classes added to the
|
|
13
|
+
/** Additional classes added to the switch */
|
|
14
14
|
className?: string;
|
|
15
15
|
/** Text value for the label when on */
|
|
16
16
|
label?: React.ReactNode;
|
|
17
17
|
/** Text value for the label when off */
|
|
18
18
|
labelOff?: React.ReactNode;
|
|
19
|
-
/** Flag to show if the
|
|
19
|
+
/** Flag to show if the switch is checked. */
|
|
20
20
|
isChecked?: boolean;
|
|
21
|
-
/** Flag to show if the
|
|
21
|
+
/** Flag to show if the switch has a check icon. */
|
|
22
|
+
hasCheckIcon?: boolean;
|
|
23
|
+
/** Flag to show if the switch is disabled. */
|
|
22
24
|
isDisabled?: boolean;
|
|
23
|
-
/** A callback for when the
|
|
25
|
+
/** A callback for when the switch selection changes. (isChecked, event) => {} */
|
|
24
26
|
onChange?: (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void;
|
|
25
|
-
/** Adds accessible text to the
|
|
27
|
+
/** Adds accessible text to the switch, and should describe the isChecked="true" state. When label is defined, aria-label should be set to the text string that is visible when isChecked is true. */
|
|
26
28
|
'aria-label'?: string;
|
|
27
29
|
/** Flag to reverse the layout of toggle and label (toggle on right). */
|
|
28
30
|
isReversed?: boolean;
|
|
@@ -61,6 +63,7 @@ export class Switch extends React.Component<SwitchProps & OUIAProps, { ouiaState
|
|
|
61
63
|
label,
|
|
62
64
|
labelOff,
|
|
63
65
|
isChecked,
|
|
66
|
+
hasCheckIcon,
|
|
64
67
|
isDisabled,
|
|
65
68
|
onChange,
|
|
66
69
|
isReversed,
|
|
@@ -96,6 +99,11 @@ export class Switch extends React.Component<SwitchProps & OUIAProps, { ouiaState
|
|
|
96
99
|
>
|
|
97
100
|
{label}
|
|
98
101
|
</span>
|
|
102
|
+
{hasCheckIcon && (
|
|
103
|
+
<div className={css(styles.switchToggleIcon)} aria-hidden="true">
|
|
104
|
+
<CheckIcon noVerticalAlign />
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
99
107
|
<span
|
|
100
108
|
className={css(styles.switchLabel, styles.modifiers.off)}
|
|
101
109
|
id={isAriaLabelledBy ? `${this.id}-off` : null}
|