@openedx/paragon 22.12.0 → 22.14.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/dist/Alert/_variables.scss +2 -1
- package/dist/Annotation/index.js.map +1 -1
- package/dist/Annotation/index.scss +6 -5
- package/dist/Avatar/index.js.map +1 -1
- package/dist/AvatarButton/index.js.map +1 -1
- package/dist/Breadcrumb/index.js.map +1 -1
- package/dist/Bubble/index.js +1 -0
- package/dist/Bubble/index.js.map +1 -1
- package/dist/Bubble/index.scss +3 -2
- package/dist/Button/deprecated/index.js.map +1 -1
- package/dist/Button/index.scss +19 -18
- package/dist/Card/CardCarousel/CardCarouselHeader.js +2 -2
- package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
- package/dist/Card/CardFooter.js.map +1 -1
- package/dist/Card/CardHeader.js +1 -1
- package/dist/Card/CardHeader.js.map +1 -1
- package/dist/Card/CardImageCap.js.map +1 -1
- package/dist/Card/CardStatus.js.map +1 -1
- package/dist/Card/_variables.scss +3 -2
- package/dist/Card/index.js.map +1 -1
- package/dist/Card/index.scss +10 -9
- package/dist/Chip/ChipIcon.d.ts +1 -1
- package/dist/Chip/index.js +1 -0
- package/dist/Chip/index.js.map +1 -1
- package/dist/ChipCarousel/index.js.map +1 -1
- package/dist/Collapsible/index.js.map +1 -1
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ColorPicker/index.scss +2 -1
- package/dist/DataTable/CollapsibleButtonGroup.js +2 -2
- package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
- package/dist/DataTable/DropdownFilters.js +1 -1
- package/dist/DataTable/DropdownFilters.js.map +1 -1
- package/dist/DataTable/TableRow.js.map +1 -1
- package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
- package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/TextFilter.js.map +1 -1
- package/dist/DataTable/index.scss +14 -13
- package/dist/DataTable/utils/getVisibleColumns.js +1 -1
- package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
- package/dist/Dropdown/_variables.scss +2 -1
- package/dist/Dropdown/deprecated/DropdownMenu.js +15 -19
- package/dist/Dropdown/deprecated/DropdownMenu.js.map +1 -1
- package/dist/Dropdown/deprecated/index.js +1 -1
- package/dist/Dropdown/deprecated/index.js.map +1 -1
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Dropzone/DefaultContent.js.map +1 -1
- package/dist/Dropzone/UploadProgress.js.map +1 -1
- package/dist/Dropzone/index.scss +3 -2
- package/dist/Fieldset/index.js.map +1 -1
- package/dist/Form/FormAutosuggest.js +1 -1
- package/dist/Form/FormAutosuggest.js.map +1 -1
- package/dist/Form/FormControl.js.map +1 -1
- package/dist/Form/FormControlDecorator.js.map +1 -1
- package/dist/Form/FormGroupContext.d.ts +1 -1
- package/dist/Form/FormGroupContext.js.map +1 -1
- package/dist/Form/FormText.js.map +1 -1
- package/dist/Form/_index.scss +9 -7
- package/dist/Form/_variables.scss +4 -2
- package/dist/Form/fieldUtils.js.map +1 -1
- package/dist/Hyperlink/index.js +1 -0
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Hyperlink/index.scss +3 -1
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.d.ts +13 -8
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButtonToggle/index.js.map +1 -1
- package/dist/IconButtonToggle/index.scss +3 -1
- package/dist/Input/index.js.map +1 -1
- package/dist/InputSelect/index.js.map +1 -1
- package/dist/Layout/index.js.map +1 -1
- package/dist/ListBox/index.js.map +1 -1
- package/dist/ListBoxOption/index.js.map +1 -1
- package/dist/Menu/SelectMenu.js +1 -1
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Menu/index.js +1 -1
- package/dist/Menu/index.js.map +1 -1
- package/dist/Modal/ModalContext.d.ts +1 -1
- package/dist/Modal/ModalDialog.d.ts +1 -1
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalDialogBody.js +1 -1
- package/dist/Modal/ModalDialogBody.js.map +1 -1
- package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
- package/dist/Modal/ModalLayer.d.ts +3 -3
- package/dist/Modal/ModalLayer.js.map +1 -1
- package/dist/Modal/ModalPopup.js.map +1 -1
- package/dist/Modal/_ModalDialog.scss +3 -1
- package/dist/Modal/index.js +3 -1
- package/dist/Modal/index.js.map +1 -1
- package/dist/Modal/index.scss +3 -5
- package/dist/Nav/_mixins.scss +3 -1
- package/dist/Overlay/index.d.ts +2 -2
- package/dist/PageBanner/index.js.map +1 -1
- package/dist/PageBanner/index.scss +2 -1
- package/dist/Pagination/PaginationContext.js.map +1 -1
- package/dist/Pagination/index.js.map +1 -1
- package/dist/Popover/_variables.scss +2 -1
- package/dist/Popover/index.js.map +1 -1
- package/dist/ProductTour/Checkpoint.scss +9 -8
- package/dist/ProductTour/index.js +1 -1
- package/dist/ProductTour/index.js.map +1 -1
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/Scrollable/index.js +1 -1
- package/dist/Scrollable/index.js.map +1 -1
- package/dist/SearchField/SearchFieldAdvanced.js.map +1 -1
- package/dist/SearchField/index.scss +2 -1
- package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
- package/dist/Sheet/index.js.map +1 -1
- package/dist/Stack/index.js.map +1 -1
- package/dist/StatefulButton/index.js.map +1 -1
- package/dist/StatusAlert/index.js.map +1 -1
- package/dist/Stepper/StepperHeader.js +1 -1
- package/dist/Stepper/StepperHeader.js.map +1 -1
- package/dist/Stepper/StepperHeaderStep.js.map +1 -1
- package/dist/Sticky/index.js.map +1 -1
- package/dist/Table/_variables.scss +2 -1
- package/dist/Tabs/deprecated/index.js.map +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tabs/index.js.map +1 -1
- package/dist/Toast/ToastContainer.scss +1 -1
- package/dist/Toast/index.scss +2 -2
- package/dist/Truncate/index.js +1 -1
- package/dist/Truncate/index.js.map +1 -1
- package/dist/ValidationFormGroup/index.js.map +1 -1
- package/dist/asInput/index.js.map +1 -1
- package/dist/hooks/useArrowKeyNavigationHook.d.ts +10 -0
- package/dist/hooks/{useArrowKeyNavigation.js → useArrowKeyNavigationHook.js} +13 -11
- package/dist/hooks/useArrowKeyNavigationHook.js.map +1 -0
- package/dist/hooks/useIndexOfLastVisibleChildHook.d.ts +12 -0
- package/dist/hooks/{useIndexOfLastVisibleChild.js → useIndexOfLastVisibleChildHook.js} +16 -12
- package/dist/hooks/useIndexOfLastVisibleChildHook.js.map +1 -0
- package/dist/hooks/useIsVisibleHook.d.ts +3 -0
- package/dist/hooks/{useIsVisible.js → useIsVisibleHook.js} +2 -2
- package/dist/hooks/useIsVisibleHook.js.map +1 -0
- package/dist/hooks/useToggleHook.d.ts +12 -0
- package/dist/hooks/useToggleHook.js +31 -0
- package/dist/hooks/useToggleHook.js.map +1 -0
- package/dist/hooks/useWindowSizeHook.d.ts +6 -0
- package/dist/hooks/{useWindowSize.js → useWindowSizeHook.js} +1 -1
- package/dist/hooks/useWindowSizeHook.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/paragon.css +1 -45
- package/dist/utils/newId.js.map +1 -1
- package/dist/withDeprecatedProps.js.map +1 -1
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/CHANGELOG.md +50 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/LICENSE +7 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/README.md +37 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.d.ts +20 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.js +79 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/dist/index.js.map +1 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/package.json +40 -0
- package/icons/node_modules/@svgr/babel-plugin-add-jsx-attribute/tsconfig.json +4 -0
- package/icons/package.json +1 -1
- package/package.json +12 -19
- package/scss/core/_exports.module.scss +7 -6
- package/scss/core/_functions.scss +9 -7
- package/scss/core/_typography.scss +2 -1
- package/scss/core/_utilities.scss +2 -1
- package/scss/core/_variables.scss +98 -95
- package/src/Alert/_variables.scss +2 -1
- package/src/Annotation/index.scss +6 -5
- package/src/Breadcrumb/Breadcrumb.test.jsx +3 -2
- package/src/Bubble/index.scss +3 -2
- package/src/Bubble/index.tsx +1 -0
- package/src/Button/deprecated/Button.test.jsx +6 -4
- package/src/Button/index.scss +19 -18
- package/src/Card/CardCarousel/tests/CardCarouselControls.test.jsx +6 -4
- package/src/Card/_variables.scss +3 -2
- package/src/Card/index.scss +10 -9
- package/src/Chip/index.tsx +1 -0
- package/src/Collapsible/Collapsible.test.jsx +15 -7
- package/src/ColorPicker/ColorPicker.test.jsx +9 -16
- package/src/ColorPicker/index.jsx +1 -1
- package/src/ColorPicker/index.scss +2 -1
- package/src/DataTable/CollapsibleButtonGroup.jsx +2 -2
- package/src/DataTable/DropdownFilters.jsx +1 -1
- package/src/DataTable/dataviews.mdx +1 -8
- package/src/DataTable/index.scss +14 -13
- package/src/DataTable/selection/tests/ControlledSelectHeader.test.jsx +6 -4
- package/src/DataTable/tests/BulkActions.test.jsx +2 -4
- package/src/DataTable/tests/DataViewToggle.test.jsx +3 -7
- package/src/DataTable/tests/DropdownFilters.test.jsx +1 -1
- package/src/DataTable/tests/TableActions.test.jsx +1 -1
- package/src/Dropdown/_variables.scss +2 -1
- package/src/Dropdown/deprecated/Dropdown.test.jsx +43 -27
- package/src/Dropzone/README.md +3 -3
- package/src/Dropzone/index.scss +3 -2
- package/src/Dropzone/tests/__snapshots__/Dropzone.test.jsx.snap +10 -1
- package/src/Form/FormAutosuggest.jsx +1 -1
- package/src/Form/FormGroupContext.tsx +1 -1
- package/src/Form/_index.scss +9 -7
- package/src/Form/_variables.scss +4 -2
- package/src/Form/tests/FormAutosuggest.test.jsx +76 -57
- package/src/Form/tests/FormCheckboxSet.test.jsx +3 -2
- package/src/Form/tests/FormControl.test.jsx +9 -6
- package/src/Form/tests/FormRadioSet.test.jsx +3 -2
- package/src/Hyperlink/index.scss +3 -1
- package/src/Hyperlink/index.tsx +1 -0
- package/src/IconButtonToggle/IconButtonToggle.test.jsx +3 -2
- package/src/IconButtonToggle/index.scss +3 -1
- package/src/ListBox/ListBox.test.jsx +8 -4
- package/src/Menu/Menu.test.jsx +15 -10
- package/src/Menu/SelectMenu.jsx +1 -1
- package/src/Menu/index.jsx +1 -1
- package/src/Modal/ModalDialogBody.jsx +1 -1
- package/src/Modal/_ModalDialog.scss +3 -1
- package/src/Modal/index.jsx +2 -0
- package/src/Modal/index.scss +3 -5
- package/src/Modal/tests/ModalLayer.test.tsx +3 -2
- package/src/Nav/_mixins.scss +3 -1
- package/src/OverflowScroll/data/tests/useOverflowScroll.test.jsx +1 -2
- package/src/OverflowScroll/data/tests/useOverflowScrollActions.test.jsx +1 -1
- package/src/OverflowScroll/data/tests/useOverflowScrollElementAttributes.test.jsx +1 -1
- package/src/OverflowScroll/data/tests/useOverflowScrollEventListeners.test.jsx +1 -2
- package/src/PageBanner/index.scss +2 -1
- package/src/Pagination/Pagination.test.jsx +36 -28
- package/src/Popover/_variables.scss +2 -1
- package/src/ProductTour/Checkpoint.scss +9 -8
- package/src/ProductTour/Checkpoint.test.jsx +3 -2
- package/src/ProductTour/ProductTour.test.jsx +11 -24
- package/src/ProductTour/index.jsx +1 -1
- package/src/Scrollable/Scrollable.test.jsx +2 -2
- package/src/Scrollable/index.jsx +1 -1
- package/src/SearchField/index.scss +2 -1
- package/src/SelectableBox/tests/SelectableBox.test.jsx +3 -2
- package/src/StatusAlert/StatusAlert.test.jsx +6 -2
- package/src/Stepper/StepperHeader.jsx +1 -1
- package/src/Stepper/tests/Stepper.test.jsx +1 -1
- package/src/Table/_variables.scss +2 -1
- package/src/Tabs/Tabs.test.jsx +1 -1
- package/src/Tabs/deprecated/Tabs.test.jsx +6 -4
- package/src/Tabs/index.jsx +1 -1
- package/src/Toast/ToastContainer.scss +1 -1
- package/src/Toast/index.scss +2 -2
- package/src/Truncate/index.jsx +1 -1
- package/src/hooks/tests/{useIndexOfLastVisibleChild.test.jsx → useIndexOfLastVisibleChild.test.tsx} +2 -2
- package/src/hooks/tests/{useToggle.test.jsx → useToggle.test.tsx} +2 -1
- package/src/hooks/{useArrowKeyNavigation.jsx → useArrowKeyNavigationHook.tsx} +41 -13
- package/src/hooks/{useIndexOfLastVisibleChild.jsx → useIndexOfLastVisibleChildHook.tsx} +22 -16
- package/src/hooks/{useIsVisible.jsx → useIsVisibleHook.tsx} +6 -3
- package/src/hooks/useToggleHook.tsx +42 -0
- package/src/hooks/{useWindowSize.jsx → useWindowSizeHook.tsx} +7 -2
- package/src/index.d.ts +5 -5
- package/src/index.js +5 -5
- package/dist/hooks/useArrowKeyNavigation.js.map +0 -1
- package/dist/hooks/useIndexOfLastVisibleChild.js.map +0 -1
- package/dist/hooks/useIsVisible.js.map +0 -1
- package/dist/hooks/useToggle.js +0 -38
- package/dist/hooks/useToggle.js.map +0 -1
- package/dist/hooks/useWindowSize.js.map +0 -1
- package/src/DataTable/tests/utils.js +0 -9
- package/src/hooks/useToggle.jsx +0 -37
- /package/src/hooks/tests/{useWindowSize.test.jsx → useWindowSize.test.tsx} +0 -0
package/src/Menu/index.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import useArrowKeyNavigation from '../hooks/
|
|
4
|
+
import useArrowKeyNavigation from '../hooks/useArrowKeyNavigationHook';
|
|
5
5
|
|
|
6
6
|
function Menu({
|
|
7
7
|
as,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
1
3
|
.pgn__modal {
|
|
2
4
|
background: $modal-content-bg;
|
|
3
5
|
border-radius: $modal-content-inner-border-radius;
|
|
@@ -315,7 +317,7 @@
|
|
|
315
317
|
|
|
316
318
|
.pgn__alert-modal__title_icon {
|
|
317
319
|
flex-shrink: 0;
|
|
318
|
-
margin-right: map
|
|
320
|
+
margin-right: map.get($spacers, 2\.5);
|
|
319
321
|
}
|
|
320
322
|
}
|
|
321
323
|
}
|
package/src/Modal/index.jsx
CHANGED
|
@@ -50,6 +50,8 @@ class Modal extends React.Component {
|
|
|
50
50
|
|
|
51
51
|
componentWillUnmount() {
|
|
52
52
|
if (this.parentElement) {
|
|
53
|
+
// TODO: update this to use the new createRoot() compatible APIs.
|
|
54
|
+
// eslint-disable-next-line react/no-deprecated
|
|
53
55
|
ReactDOM.unmountComponentAtNode(this.parentElement);
|
|
54
56
|
}
|
|
55
57
|
}
|
package/src/Modal/index.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@import "variables";
|
|
2
3
|
@import "~bootstrap/scss/modal";
|
|
3
4
|
@import "ModalDialog";
|
|
@@ -19,12 +20,9 @@
|
|
|
19
20
|
|
|
20
21
|
.pgn__modal-backdrop {
|
|
21
22
|
background: $modal-backdrop-bg;
|
|
22
|
-
|
|
23
|
-
left: 0;
|
|
23
|
+
inset: 0;
|
|
24
24
|
opacity: $modal-backdrop-opacity;
|
|
25
25
|
position: fixed;
|
|
26
|
-
right: 0;
|
|
27
|
-
top: 0;
|
|
28
26
|
z-index: 0;
|
|
29
27
|
}
|
|
30
28
|
|
|
@@ -88,7 +86,7 @@
|
|
|
88
86
|
margin: auto;
|
|
89
87
|
padding: calc($spacer / 2);
|
|
90
88
|
|
|
91
|
-
@media (min-width: map
|
|
89
|
+
@media (min-width: map.get($grid-breakpoints, "sm")) {
|
|
92
90
|
padding: $spacer;
|
|
93
91
|
}
|
|
94
92
|
}
|
|
@@ -78,7 +78,8 @@ describe('<ModalLayer />', () => {
|
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
describe('Dismiss modal', () => {
|
|
81
|
-
it('closes a non-blocking modal layer when backdrop is clicked', () => {
|
|
81
|
+
it('closes a non-blocking modal layer when backdrop is clicked', async () => {
|
|
82
|
+
const user = userEvent.setup();
|
|
82
83
|
const closeFn = jest.fn();
|
|
83
84
|
render(
|
|
84
85
|
<ModalLayer isOpen onClose={closeFn} isBlocking={false}>
|
|
@@ -86,7 +87,7 @@ describe('<ModalLayer />', () => {
|
|
|
86
87
|
</ModalLayer>,
|
|
87
88
|
);
|
|
88
89
|
const backdrop = screen.getByTestId('modal-backdrop');
|
|
89
|
-
|
|
90
|
+
await user.click(backdrop);
|
|
90
91
|
expect(closeFn).toHaveBeenCalled();
|
|
91
92
|
});
|
|
92
93
|
|
package/src/Nav/_mixins.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
1
3
|
@mixin nav-tabs-link-focus(
|
|
2
4
|
$border-color,
|
|
3
5
|
$radius: $nav-tabs-border-radius,
|
|
@@ -5,7 +7,7 @@
|
|
|
5
7
|
) {
|
|
6
8
|
position: relative;
|
|
7
9
|
outline: 0;
|
|
8
|
-
z-index: map
|
|
10
|
+
z-index: map.get($map: $indexes, $key: 1);
|
|
9
11
|
|
|
10
12
|
&::before {
|
|
11
13
|
content: "";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { renderHook } from '@testing-library/react
|
|
3
|
-
import { act } from '@testing-library/react';
|
|
2
|
+
import { act, renderHook } from '@testing-library/react';
|
|
4
3
|
import useOverflowScroll from '../useOverflowScroll';
|
|
5
4
|
import useOverflowScrollActions from '../useOverflowScrollActions';
|
|
6
5
|
import getChildrenElements from '../getChildrenElements';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { renderHook } from '@testing-library/react
|
|
2
|
-
import { act } from '@testing-library/react';
|
|
1
|
+
import { act, renderHook } from '@testing-library/react';
|
|
3
2
|
import useOverflowScrollEventListeners from '../useOverflowScrollEventListeners';
|
|
4
3
|
|
|
5
4
|
const divElement = document.createElement('div');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
// stylelint-disable-next-line selector-class-pattern
|
|
2
3
|
.pgn__pageBanner-component {
|
|
3
4
|
width: 100%;
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
flex-grow: 1;
|
|
47
48
|
justify-content: center;
|
|
48
49
|
align-items: center;
|
|
49
|
-
padding:
|
|
50
|
+
padding: map.get($spacers, 2) map.get($spacers, 2\.5);
|
|
50
51
|
text-align: center;
|
|
51
52
|
}
|
|
52
53
|
|
|
@@ -3,7 +3,6 @@ import { Context as ResponsiveContext } from 'react-responsive';
|
|
|
3
3
|
import renderer from 'react-test-renderer';
|
|
4
4
|
import {
|
|
5
5
|
render,
|
|
6
|
-
act,
|
|
7
6
|
screen,
|
|
8
7
|
} from '@testing-library/react';
|
|
9
8
|
import userEvent from '@testing-library/user-event';
|
|
@@ -66,48 +65,53 @@ describe('<Pagination />', () => {
|
|
|
66
65
|
});
|
|
67
66
|
|
|
68
67
|
describe('handles controlled and uncontrolled behaviour properly', () => {
|
|
69
|
-
it('does not internally change page on page click if currentPage is provided', () => {
|
|
68
|
+
it('does not internally change page on page click if currentPage is provided', async () => {
|
|
69
|
+
const user = userEvent.setup();
|
|
70
70
|
render(<Pagination {...baseProps} />);
|
|
71
71
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('1');
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
await user.click(screen.getByText(PAGINATION_BUTTON_LABEL_NEXT));
|
|
74
74
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('1');
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
await user.click(screen.getByRole('button', { name: `${PAGINATION_BUTTON_LABEL_PAGE} 3` }));
|
|
77
77
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('1');
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
it('controls page selection internally if currentPage is not provided', () => {
|
|
80
|
+
it('controls page selection internally if currentPage is not provided', async () => {
|
|
81
|
+
const user = userEvent.setup();
|
|
81
82
|
render(<Pagination {...baseProps} currentPage={undefined} />);
|
|
82
83
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('1');
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
await user.click(screen.getByText(PAGINATION_BUTTON_LABEL_NEXT));
|
|
85
86
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('2');
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
await user.click(screen.getByRole('button', { name: `${PAGINATION_BUTTON_LABEL_PAGE} 3` }));
|
|
88
89
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('3');
|
|
89
90
|
|
|
90
|
-
|
|
91
|
+
await user.click(screen.getByText(PAGINATION_BUTTON_LABEL_PREV));
|
|
91
92
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('2');
|
|
92
93
|
});
|
|
93
94
|
|
|
94
|
-
it('does not chang page if you click "next" button while on last page', () => {
|
|
95
|
+
it('does not chang page if you click "next" button while on last page', async () => {
|
|
96
|
+
const user = userEvent.setup();
|
|
95
97
|
render(<Pagination {...baseProps} currentPage={undefined} initialPage={5} />);
|
|
96
98
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('5');
|
|
97
|
-
|
|
99
|
+
await user.click(screen.getByText(PAGINATION_BUTTON_LABEL_NEXT));
|
|
98
100
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('5');
|
|
99
101
|
});
|
|
100
102
|
|
|
101
|
-
it('does not chang page if you click "previous" button while on first page', () => {
|
|
103
|
+
it('does not chang page if you click "previous" button while on first page', async () => {
|
|
104
|
+
const user = userEvent.setup();
|
|
102
105
|
render(<Pagination {...baseProps} currentPage={undefined} initialPage={1} />);
|
|
103
106
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('1');
|
|
104
|
-
|
|
107
|
+
await user.click(screen.getByText(PAGINATION_BUTTON_LABEL_PREV));
|
|
105
108
|
expect(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false })).toHaveTextContent('1');
|
|
106
109
|
});
|
|
107
110
|
});
|
|
108
111
|
|
|
109
112
|
describe('handles focus properly', () => {
|
|
110
|
-
it('should change focus to next button if previous page is first page', () => {
|
|
113
|
+
it('should change focus to next button if previous page is first page', async () => {
|
|
114
|
+
const user = userEvent.setup();
|
|
111
115
|
const props = {
|
|
112
116
|
...baseProps,
|
|
113
117
|
currentPage: 2,
|
|
@@ -117,11 +121,12 @@ describe('<Pagination />', () => {
|
|
|
117
121
|
},
|
|
118
122
|
};
|
|
119
123
|
render(<Pagination {...props} />);
|
|
120
|
-
|
|
124
|
+
await user.click(screen.getByText(PAGINATION_BUTTON_LABEL_PREV));
|
|
121
125
|
expect(screen.getByText(PAGINATION_BUTTON_LABEL_NEXT)).toHaveFocus();
|
|
122
126
|
});
|
|
123
127
|
|
|
124
|
-
it('should change focus to previous button if next page is last page', () => {
|
|
128
|
+
it('should change focus to previous button if next page is last page', async () => {
|
|
129
|
+
const user = userEvent.setup();
|
|
125
130
|
const props = {
|
|
126
131
|
...baseProps,
|
|
127
132
|
currentPage: baseProps.pageCount - 1,
|
|
@@ -131,7 +136,7 @@ describe('<Pagination />', () => {
|
|
|
131
136
|
},
|
|
132
137
|
};
|
|
133
138
|
render(<Pagination {...props} />);
|
|
134
|
-
|
|
139
|
+
await user.click(screen.getByText(props.buttonLabel.next));
|
|
135
140
|
expect(screen.getByText(props.buttonLabel.previous)).toHaveFocus();
|
|
136
141
|
});
|
|
137
142
|
});
|
|
@@ -191,7 +196,8 @@ describe('<Pagination />', () => {
|
|
|
191
196
|
});
|
|
192
197
|
|
|
193
198
|
describe('should fire callbacks properly', () => {
|
|
194
|
-
it('should not fire onPageSelect when selecting current page', () => {
|
|
199
|
+
it('should not fire onPageSelect when selecting current page', async () => {
|
|
200
|
+
const user = userEvent.setup();
|
|
195
201
|
const spy = jest.fn();
|
|
196
202
|
const props = {
|
|
197
203
|
...baseProps,
|
|
@@ -203,11 +209,12 @@ describe('<Pagination />', () => {
|
|
|
203
209
|
</ResponsiveContext.Provider>
|
|
204
210
|
));
|
|
205
211
|
|
|
206
|
-
|
|
212
|
+
await user.click(screen.getByLabelText(PAGINATION_BUTTON_LABEL_CURRENT_PAGE, { exact: false }));
|
|
207
213
|
expect(spy).toHaveBeenCalledTimes(0);
|
|
208
214
|
});
|
|
209
215
|
|
|
210
|
-
it('should fire onPageSelect callback when selecting new page', () => {
|
|
216
|
+
it('should fire onPageSelect callback when selecting new page', async () => {
|
|
217
|
+
const user = userEvent.setup();
|
|
211
218
|
const spy = jest.fn();
|
|
212
219
|
const props = {
|
|
213
220
|
...baseProps,
|
|
@@ -219,17 +226,18 @@ describe('<Pagination />', () => {
|
|
|
219
226
|
</ResponsiveContext.Provider>
|
|
220
227
|
));
|
|
221
228
|
|
|
222
|
-
|
|
229
|
+
await user.click(screen.getByLabelText(`${PAGINATION_BUTTON_LABEL_PAGE} 2`));
|
|
223
230
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
224
231
|
|
|
225
|
-
|
|
232
|
+
await user.click(screen.getByLabelText(`${PAGINATION_BUTTON_LABEL_PAGE} 3`));
|
|
226
233
|
expect(spy).toHaveBeenCalledTimes(2);
|
|
227
234
|
});
|
|
228
235
|
});
|
|
229
236
|
});
|
|
230
237
|
|
|
231
238
|
describe('fires previous and next button click handlers', () => {
|
|
232
|
-
it('previous button onClick', () => {
|
|
239
|
+
it('previous button onClick', async () => {
|
|
240
|
+
const user = userEvent.setup();
|
|
233
241
|
const spy = jest.fn();
|
|
234
242
|
const props = {
|
|
235
243
|
...baseProps,
|
|
@@ -238,11 +246,12 @@ describe('<Pagination />', () => {
|
|
|
238
246
|
};
|
|
239
247
|
render(<Pagination {...props} />);
|
|
240
248
|
const expectedPrevButtonAriaLabel = `${PAGINATION_BUTTON_LABEL_PREV}, ${PAGINATION_BUTTON_LABEL_PAGE} 2`;
|
|
241
|
-
|
|
249
|
+
await user.click(screen.getByRole('button', { name: expectedPrevButtonAriaLabel }));
|
|
242
250
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
243
251
|
});
|
|
244
252
|
|
|
245
|
-
it('next button onClick', () => {
|
|
253
|
+
it('next button onClick', async () => {
|
|
254
|
+
const user = userEvent.setup();
|
|
246
255
|
const spy = jest.fn();
|
|
247
256
|
const props = {
|
|
248
257
|
...baseProps,
|
|
@@ -250,7 +259,7 @@ describe('<Pagination />', () => {
|
|
|
250
259
|
};
|
|
251
260
|
render(<Pagination {...props} />);
|
|
252
261
|
const expectedNextButtonAriaLabel = `${PAGINATION_BUTTON_LABEL_NEXT}, ${PAGINATION_BUTTON_LABEL_PAGE} 2`;
|
|
253
|
-
|
|
262
|
+
await user.click(screen.getByRole('button', { name: expectedNextButtonAriaLabel }));
|
|
254
263
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
255
264
|
});
|
|
256
265
|
});
|
|
@@ -318,13 +327,12 @@ describe('<Pagination />', () => {
|
|
|
318
327
|
});
|
|
319
328
|
|
|
320
329
|
it('for the reduced variant shows dropdown button with the page count as label', async () => {
|
|
330
|
+
const user = userEvent.setup();
|
|
321
331
|
render(<Pagination variant="reduced" {...props} />);
|
|
322
332
|
|
|
323
333
|
const dropdownLabel = `${baseProps.currentPage} de ${baseProps.pageCount}`;
|
|
324
334
|
|
|
325
|
-
await
|
|
326
|
-
userEvent.click(screen.getByRole('button', { name: dropdownLabel }));
|
|
327
|
-
});
|
|
335
|
+
await user.click(screen.getByRole('button', { name: dropdownLabel }));
|
|
328
336
|
expect(screen.queryAllByRole('button', { name: /^\d+$/ }).length).toEqual(baseProps.pageCount);
|
|
329
337
|
});
|
|
330
338
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:color";
|
|
1
2
|
// Popovers
|
|
2
3
|
|
|
3
4
|
$popover-font-size: $font-size-sm !default;
|
|
@@ -26,7 +27,7 @@ $popover-arrow-width: 1rem !default;
|
|
|
26
27
|
$popover-arrow-height: .5rem !default;
|
|
27
28
|
$popover-arrow-color: $popover-bg !default;
|
|
28
29
|
|
|
29
|
-
$popover-arrow-outer-color:
|
|
30
|
+
$popover-arrow-outer-color: color.adjust($popover-border-color, $alpha: .05) !default;
|
|
30
31
|
|
|
31
32
|
$popover-success-bg: $success-100 !default;
|
|
32
33
|
$popover-success-icon-color: $success-500 !default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@import "variables";
|
|
2
3
|
|
|
3
4
|
$checkpoint-arrow-top-color: solid $checkpoint-arrow-width $checkpoint-border-color;
|
|
@@ -9,12 +10,12 @@ $checkpoint-arrow-transparent: solid $checkpoint-arrow-width transparent;
|
|
|
9
10
|
background: $checkpoint-background-color;
|
|
10
11
|
border-top: $checkpoint-border-width solid $checkpoint-border-color;
|
|
11
12
|
border-radius: $border-radius;
|
|
12
|
-
padding:
|
|
13
|
+
padding: map.get($spacers, 4);
|
|
13
14
|
box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .3);
|
|
14
15
|
z-index: $checkpoint-z-index;
|
|
15
16
|
max-width: $checkpoint-max-width;
|
|
16
17
|
|
|
17
|
-
@media (max-width: map
|
|
18
|
+
@media (max-width: map.get($grid-breakpoints, "md")) {
|
|
18
19
|
min-width: 90%;
|
|
19
20
|
max-width: 90%;
|
|
20
21
|
}
|
|
@@ -43,7 +44,7 @@ $checkpoint-arrow-transparent: solid $checkpoint-arrow-width transparent;
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
.pgn__checkpoint-button_dismiss {
|
|
46
|
-
margin-inline-end:
|
|
47
|
+
margin-inline-end: map.get($spacers, 2);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
.pgn__checkpoint-breadcrumb {
|
|
@@ -61,11 +62,11 @@ $checkpoint-arrow-transparent: solid $checkpoint-arrow-width transparent;
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
&:not(:first-child) {
|
|
64
|
-
margin-left:
|
|
65
|
+
margin-left: map.get($spacers, 1\.5);
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
[dir="rtl"] & {
|
|
68
|
-
margin-left:
|
|
69
|
+
margin-left: map.get($spacers, 1\.5);
|
|
69
70
|
margin-right: 0;
|
|
70
71
|
|
|
71
72
|
&:last-child {
|
|
@@ -81,19 +82,19 @@ $checkpoint-arrow-transparent: solid $checkpoint-arrow-width transparent;
|
|
|
81
82
|
|
|
82
83
|
.pgn__checkpoint-body {
|
|
83
84
|
color: $checkpoint-body-color;
|
|
84
|
-
margin-bottom:
|
|
85
|
+
margin-bottom: map.get($spacers, 3\.5);
|
|
85
86
|
text-align: start;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
.pgn__checkpoint-header {
|
|
89
90
|
display: flex;
|
|
90
91
|
justify-content: space-between;
|
|
91
|
-
margin-bottom:
|
|
92
|
+
margin-bottom: map.get($spacers, 2\.5);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
#pgn__checkpoint-title {
|
|
95
96
|
font-size: $h3-font-size;
|
|
96
|
-
margin-inline-end:
|
|
97
|
+
margin-inline-end: map.get($spacers, 2\.5);
|
|
97
98
|
margin-bottom: 0;
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
|
|
4
4
|
import { IntlProvider } from 'react-intl';
|
|
5
5
|
|
|
6
6
|
import * as popper from '@popperjs/core';
|
|
@@ -100,8 +100,9 @@ describe('Checkpoint', () => {
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
it('end button onClick calls handleEnd', async () => {
|
|
103
|
+
const user = userEvent.setup({ pointerEventsCheck: PointerEventsCheckLevel.Never });
|
|
103
104
|
const endButton = screen.getByText('End', { selector: 'button' });
|
|
104
|
-
await
|
|
105
|
+
await user.click(endButton);
|
|
105
106
|
expect(handleEnd).toHaveBeenCalledTimes(1);
|
|
106
107
|
});
|
|
107
108
|
});
|
|
@@ -144,6 +144,7 @@ describe('<ProductTour />', () => {
|
|
|
144
144
|
});
|
|
145
145
|
|
|
146
146
|
it('onClick of end button disables tour', async () => {
|
|
147
|
+
const user = userEvent.setup();
|
|
147
148
|
const { rerender } = render(<ProductTourWrapper tours={[tourData]} />);
|
|
148
149
|
|
|
149
150
|
// Verify a Checkpoint has rendered
|
|
@@ -151,29 +152,21 @@ describe('<ProductTour />', () => {
|
|
|
151
152
|
|
|
152
153
|
// Advance the Tour to the last Checkpoint
|
|
153
154
|
const advanceButton1 = screen.getByRole('button', { name: 'Next' });
|
|
154
|
-
await
|
|
155
|
-
await userEvent.click(advanceButton1);
|
|
156
|
-
});
|
|
155
|
+
await user.click(advanceButton1);
|
|
157
156
|
|
|
158
157
|
const advanceButton2 = screen.getByRole('button', { name: 'Next' });
|
|
159
|
-
await
|
|
160
|
-
await userEvent.click(advanceButton2);
|
|
161
|
-
});
|
|
158
|
+
await user.click(advanceButton2);
|
|
162
159
|
|
|
163
160
|
rerender(<ProductTourWrapper tours={[tourData]} />);
|
|
164
161
|
|
|
165
162
|
const advanceButton3 = screen.getByRole('button', { name: 'Override advance' });
|
|
166
|
-
await
|
|
167
|
-
await userEvent.click(advanceButton3);
|
|
168
|
-
});
|
|
163
|
+
await user.click(advanceButton3);
|
|
169
164
|
|
|
170
165
|
rerender(<ProductTourWrapper tours={[tourData]} />);
|
|
171
166
|
|
|
172
167
|
// Click the end button
|
|
173
168
|
const endButton = screen.getByRole('button', { name: 'End' });
|
|
174
|
-
await
|
|
175
|
-
await userEvent.click(endButton);
|
|
176
|
-
});
|
|
169
|
+
await user.click(endButton);
|
|
177
170
|
|
|
178
171
|
// Verify no Checkpoints have rendered
|
|
179
172
|
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
@@ -188,9 +181,7 @@ describe('<ProductTour />', () => {
|
|
|
188
181
|
expect(screen.getByRole('dialog', { name: 'Checkpoint 1' })).toBeInTheDocument();
|
|
189
182
|
|
|
190
183
|
// Click Escape key
|
|
191
|
-
await
|
|
192
|
-
await userEvent.keyboard('{escape}');
|
|
193
|
-
});
|
|
184
|
+
await userEvent.keyboard('{Escape}');
|
|
194
185
|
|
|
195
186
|
// Verify no Checkpoints have been rendered
|
|
196
187
|
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
@@ -271,31 +262,27 @@ describe('<ProductTour />', () => {
|
|
|
271
262
|
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
272
263
|
});
|
|
273
264
|
it('calls customHandleOnEnd onClick of end button', async () => {
|
|
265
|
+
const user = userEvent.setup();
|
|
274
266
|
const { rerender } = render(<ProductTourWrapper tours={[overrideTourData]} />);
|
|
275
267
|
const advanceButton = screen.getByRole('button', { name: 'Override advance' });
|
|
276
|
-
await
|
|
277
|
-
await userEvent.click(advanceButton);
|
|
278
|
-
});
|
|
268
|
+
await user.click(advanceButton);
|
|
279
269
|
|
|
280
270
|
rerender(<ProductTourWrapper tours={[overrideTourData]} />);
|
|
281
271
|
|
|
282
272
|
expect(screen.getByText('Checkpoint 4')).toBeInTheDocument();
|
|
283
273
|
const endButton = screen.getByRole('button', { name: 'Override end' });
|
|
284
|
-
await
|
|
285
|
-
await userEvent.click(endButton);
|
|
286
|
-
});
|
|
274
|
+
await user.click(endButton);
|
|
287
275
|
expect(handleEnd).toBeCalledTimes(1);
|
|
288
276
|
expect(customOnEnd).toHaveBeenCalledTimes(1);
|
|
289
277
|
expect(screen.queryByText('Checkpoint 4')).not.toBeInTheDocument();
|
|
290
278
|
});
|
|
291
279
|
it('calls onEscape on escape button key press', async () => {
|
|
280
|
+
const user = userEvent.setup();
|
|
292
281
|
render(<ProductTourWrapper tours={[overrideTourData]} />);
|
|
293
282
|
expect(screen.getByText('Checkpoint 3')).toBeInTheDocument();
|
|
294
283
|
const container = screen.getByRole('dialog');
|
|
295
284
|
container.focus();
|
|
296
|
-
await
|
|
297
|
-
await userEvent.keyboard('{escape}');
|
|
298
|
-
});
|
|
285
|
+
await user.keyboard('{Escape}');
|
|
299
286
|
expect(handleEscape).toHaveBeenCalledTimes(1);
|
|
300
287
|
expect(screen.queryByText('Checkpoint 3')).not.toBeInTheDocument();
|
|
301
288
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react'; // (or /dom, /vue, ...)
|
|
3
|
-
import useIsVisible from '../hooks/
|
|
3
|
+
import useIsVisible from '../hooks/useIsVisibleHook';
|
|
4
4
|
|
|
5
5
|
import Scrollable, { CLASSNAME_SCROLL_BOTTOM, CLASSNAME_SCROLL_TOP } from '.';
|
|
6
6
|
|
|
7
|
-
jest.mock('../hooks/
|
|
7
|
+
jest.mock('../hooks/useIsVisibleHook');
|
|
8
8
|
|
|
9
9
|
function rangeOfNumbers() {
|
|
10
10
|
return Array.from({ length: 50 }, (v, k) => k + 1);
|
package/src/Scrollable/index.jsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
import useIsVisible from '../hooks/
|
|
5
|
+
import useIsVisible from '../hooks/useIsVisibleHook';
|
|
6
6
|
|
|
7
7
|
export const CLASSNAME_SCROLL_TOP = 'pgn__scrollable-body-scroll-top';
|
|
8
8
|
export const CLASSNAME_SCROLL_BOTTOM = 'pgn__scrollable-body-scroll-bottom';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@import "variables";
|
|
2
3
|
|
|
3
4
|
.pgn__searchfield {
|
|
@@ -129,5 +130,5 @@
|
|
|
129
130
|
.pgn__searchfield__iconbutton-submit,
|
|
130
131
|
.pgn__searchfield__iconbutton-reset {
|
|
131
132
|
flex-shrink: 0;
|
|
132
|
-
margin-inline-end: map
|
|
133
|
+
margin-inline-end: map.get($spacers, 1);
|
|
133
134
|
}
|
|
@@ -123,12 +123,13 @@ describe('<SelectableBox />', () => {
|
|
|
123
123
|
rerender(<SelectableRadio checked />);
|
|
124
124
|
expect(radio.className).toContain('pgn__selectable_box-active');
|
|
125
125
|
});
|
|
126
|
-
it('ref is passed to onClick function', () => {
|
|
126
|
+
it('ref is passed to onClick function', async () => {
|
|
127
|
+
const user = userEvent.setup();
|
|
127
128
|
let inputRef;
|
|
128
129
|
const onClick = (ref) => { inputRef = ref; };
|
|
129
130
|
render(<SelectableRadio onClick={onClick} />);
|
|
130
131
|
const radio = screen.getByRole('button');
|
|
131
|
-
|
|
132
|
+
await user.click(radio);
|
|
132
133
|
expect(inputRef).not.toBeFalsy();
|
|
133
134
|
});
|
|
134
135
|
});
|
|
@@ -113,17 +113,21 @@ describe('<StatusAlert />', () => {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
it('does nothing on invalid keystroke q', async () => {
|
|
116
|
+
const user = userEvent.setup();
|
|
116
117
|
const closeButton = screen.getByRole('button');
|
|
117
118
|
expect(document.activeElement).toEqual(closeButton);
|
|
118
119
|
closeButton.focus();
|
|
119
|
-
await
|
|
120
|
+
await user.keyboard('{q}');
|
|
120
121
|
expect(document.activeElement).toEqual(closeButton);
|
|
121
122
|
});
|
|
122
123
|
|
|
123
124
|
it('does nothing on invalid keystroke + ctrl', async () => {
|
|
125
|
+
const user = userEvent.setup();
|
|
124
126
|
const closeButton = screen.getByRole('button');
|
|
125
127
|
expect(document.activeElement).toEqual(closeButton);
|
|
126
|
-
|
|
128
|
+
// This was '{Control>}{Tab}{/Control}' before, but that _does_ seem to be changing the focus in newer RTL/React.
|
|
129
|
+
// I don't think that was the point of the test though, so it's 'z' for now.
|
|
130
|
+
await user.keyboard('{Control>}z{/Control}');
|
|
127
131
|
expect(document.activeElement).toEqual(closeButton);
|
|
128
132
|
});
|
|
129
133
|
});
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import StepperHeaderStep from './StepperHeaderStep';
|
|
5
5
|
import { StepperContext } from './StepperContext';
|
|
6
|
-
import useWindowSize from '../hooks/
|
|
6
|
+
import useWindowSize from '../hooks/useWindowSizeHook';
|
|
7
7
|
import breakpoints, { Size } from '../utils/breakpoints';
|
|
8
8
|
|
|
9
9
|
function StepListSeparator() {
|
|
@@ -7,7 +7,7 @@ import { stepsReducer } from '../StepperContext';
|
|
|
7
7
|
|
|
8
8
|
const mockWindowSize = { width: 1000, height: 1000 };
|
|
9
9
|
|
|
10
|
-
jest.mock('../../hooks/
|
|
10
|
+
jest.mock('../../hooks/useWindowSizeHook', () => () => mockWindowSize);
|
|
11
11
|
|
|
12
12
|
function Example({
|
|
13
13
|
// eslint-disable-next-line react/prop-types
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:color";
|
|
1
2
|
// Tables
|
|
2
3
|
//
|
|
3
4
|
// Customizes the `.table` component with basic values, each used across all table variations.
|
|
@@ -23,7 +24,7 @@ $table-dark-bg: theme-color("gray", "hover") !default;
|
|
|
23
24
|
$table-dark-accent-bg: rgba($white, .05) !default;
|
|
24
25
|
$table-dark-hover-color: $table-dark-color !default;
|
|
25
26
|
$table-dark-hover-bg: rgba($white, .075) !default;
|
|
26
|
-
$table-dark-border-color:
|
|
27
|
+
$table-dark-border-color: color.adjust($table-dark-bg, $lightness: 7.5%) !default;
|
|
27
28
|
$table-dark-color: $white !default;
|
|
28
29
|
|
|
29
30
|
$table-striped-order: odd !default;
|