@openedx/paragon 22.13.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/{useArrowKeyNavigation.js → useArrowKeyNavigationHook.js} +5 -1
- package/dist/hooks/useArrowKeyNavigationHook.js.map +1 -0
- package/dist/hooks/{useIndexOfLastVisibleChild.js → useIndexOfLastVisibleChildHook.js} +5 -1
- package/dist/hooks/useIndexOfLastVisibleChildHook.js.map +1 -0
- package/dist/hooks/{useIsVisible.js → useIsVisibleHook.js} +1 -1
- package/dist/hooks/useIsVisibleHook.js.map +1 -0
- package/dist/hooks/{useToggle.js → useToggleHook.js} +5 -1
- package/dist/hooks/useToggleHook.js.map +1 -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/useToggle.test.tsx +1 -1
- package/src/hooks/{useArrowKeyNavigation.tsx → useArrowKeyNavigationHook.tsx} +4 -0
- package/src/hooks/{useIndexOfLastVisibleChild.tsx → useIndexOfLastVisibleChildHook.tsx} +4 -0
- package/src/hooks/{useToggle.tsx → useToggleHook.tsx} +4 -0
- 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.map +0 -1
- package/dist/hooks/useWindowSize.js.map +0 -1
- package/src/DataTable/tests/utils.js +0 -9
- /package/dist/hooks/{useArrowKeyNavigation.d.ts → useArrowKeyNavigationHook.d.ts} +0 -0
- /package/dist/hooks/{useIndexOfLastVisibleChild.d.ts → useIndexOfLastVisibleChildHook.d.ts} +0 -0
- /package/dist/hooks/{useIsVisible.d.ts → useIsVisibleHook.d.ts} +0 -0
- /package/dist/hooks/{useToggle.d.ts → useToggleHook.d.ts} +0 -0
- /package/dist/hooks/{useWindowSize.d.ts → useWindowSizeHook.d.ts} +0 -0
- /package/src/hooks/{useIsVisible.tsx → useIsVisibleHook.tsx} +0 -0
- /package/src/hooks/{useWindowSize.tsx → useWindowSizeHook.tsx} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
3
3
|
import renderer from 'react-test-renderer';
|
|
4
4
|
import userEvent from '@testing-library/user-event';
|
|
5
5
|
|
|
@@ -75,17 +75,23 @@ describe('<Collapsible />', () => {
|
|
|
75
75
|
<Collapsible.Advanced ref={ref}>{collapsibleContent}</Collapsible.Advanced>,
|
|
76
76
|
);
|
|
77
77
|
});
|
|
78
|
-
it('opens on .open()', () => {
|
|
78
|
+
it('opens on .open()', async () => {
|
|
79
79
|
expect(screen.queryByText(EXAMPLE_CONTENT)).not.toBeInTheDocument();
|
|
80
80
|
ref.current.open();
|
|
81
|
-
|
|
81
|
+
await waitFor(() => {
|
|
82
|
+
expect(screen.getByText(EXAMPLE_CONTENT)).toBeInTheDocument();
|
|
83
|
+
});
|
|
82
84
|
});
|
|
83
85
|
|
|
84
|
-
it('closes on .close()', () => {
|
|
86
|
+
it('closes on .close()', async () => {
|
|
85
87
|
ref.current.open();
|
|
86
|
-
|
|
88
|
+
await waitFor(() => {
|
|
89
|
+
expect(screen.getByText(EXAMPLE_CONTENT)).toBeInTheDocument();
|
|
90
|
+
});
|
|
87
91
|
ref.current.close();
|
|
88
|
-
|
|
92
|
+
await waitFor(() => {
|
|
93
|
+
expect(screen.queryByText(EXAMPLE_CONTENT)).not.toBeInTheDocument();
|
|
94
|
+
});
|
|
89
95
|
});
|
|
90
96
|
|
|
91
97
|
it('correct behavior with unmountOnExit', () => {
|
|
@@ -127,7 +133,9 @@ describe('<Collapsible />', () => {
|
|
|
127
133
|
|
|
128
134
|
it('closes on trigger click', async () => {
|
|
129
135
|
collapsible.open();
|
|
130
|
-
|
|
136
|
+
await waitFor(() => {
|
|
137
|
+
expect(screen.getByText(EXAMPLE_CONTENT)).toBeInTheDocument();
|
|
138
|
+
});
|
|
131
139
|
await userEvent.click(screen.getAllByRole('button')[0]); // Close
|
|
132
140
|
expect(screen.queryByText(EXAMPLE_CONTENT)).not.toBeInTheDocument();
|
|
133
141
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderer from 'react-test-renderer';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import { render, screen
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
5
|
|
|
6
6
|
import ColorPicker from '.';
|
|
7
7
|
|
|
@@ -29,33 +29,26 @@ describe('picker works as expected', () => {
|
|
|
29
29
|
const color = 'wassap';
|
|
30
30
|
const setColor = jest.fn();
|
|
31
31
|
it('validates hex color', async () => {
|
|
32
|
+
const user = userEvent.setup();
|
|
32
33
|
render(<ColorPicker color={color} setColor={setColor} />);
|
|
33
34
|
|
|
34
|
-
await
|
|
35
|
-
await userEvent.click(screen.getByRole('button'));
|
|
36
|
-
});
|
|
35
|
+
await user.click(screen.getByRole('button'));
|
|
37
36
|
expect(screen.queryByTestId('hex-input').value).toEqual('#wassap');
|
|
38
37
|
expect(screen.queryByText('Colors must be in hexadecimal format.')).toBeInTheDocument();
|
|
39
38
|
|
|
40
|
-
await
|
|
41
|
-
|
|
42
|
-
await userEvent.paste(screen.getByTestId('hex-input'), '32116c');
|
|
43
|
-
});
|
|
39
|
+
await user.clear(screen.getByTestId('hex-input')); // clear() will keep focus on the element, so we can paste
|
|
40
|
+
await user.paste('32116c');
|
|
44
41
|
expect(screen.queryByTestId('hex-input').value).toEqual('#32116c');
|
|
45
42
|
expect(screen.queryByText('Colors must be in hexadecimal format.')).not.toBeInTheDocument();
|
|
46
43
|
|
|
47
|
-
await
|
|
48
|
-
|
|
49
|
-
await userEvent.paste(screen.getByTestId('hex-input'), 'yuk');
|
|
50
|
-
});
|
|
44
|
+
await user.clear(screen.getByTestId('hex-input'));
|
|
45
|
+
await user.paste('yuk');
|
|
51
46
|
|
|
52
47
|
expect(screen.queryByTestId('hex-input').value).toEqual('#yuk');
|
|
53
48
|
expect(screen.queryByText('Colors must be in hexadecimal format.')).toBeInTheDocument();
|
|
54
49
|
|
|
55
|
-
await
|
|
56
|
-
|
|
57
|
-
await userEvent.paste(screen.getByTestId('hex-input'), '#fad');
|
|
58
|
-
});
|
|
50
|
+
await user.clear(screen.getByTestId('hex-input'));
|
|
51
|
+
await user.paste('#fad');
|
|
59
52
|
|
|
60
53
|
expect(screen.queryByTestId('hex-input').value).toEqual('#fad');
|
|
61
54
|
expect(screen.queryByText('Colors must be in hexadecimal format.')).not.toBeInTheDocument();
|
|
@@ -8,7 +8,7 @@ import Form from '../Form';
|
|
|
8
8
|
import ModalPopup from '../Modal/ModalPopup';
|
|
9
9
|
import { OverlayTrigger } from '../Overlay';
|
|
10
10
|
import Tooltip from '../Tooltip';
|
|
11
|
-
import useToggle from '../hooks/
|
|
11
|
+
import useToggle from '../hooks/useToggleHook';
|
|
12
12
|
|
|
13
13
|
function ColorPicker({
|
|
14
14
|
color, setColor, className, size,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@import "variables";
|
|
2
3
|
|
|
3
4
|
.pgn__color-picker {
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
.pgn__hex-field {
|
|
58
|
-
@media (min-width: map
|
|
59
|
+
@media (min-width: map.get($grid-breakpoints, "sm")) {
|
|
59
60
|
margin-inline-end: 0;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
@@ -2,8 +2,8 @@ import React, { useContext, useMemo, useState } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
import { MoreVert } from '../../icons';
|
|
5
|
-
import useToggle from '../hooks/
|
|
6
|
-
import useWindowSize from '../hooks/
|
|
5
|
+
import useToggle from '../hooks/useToggleHook';
|
|
6
|
+
import useWindowSize from '../hooks/useWindowSizeHook';
|
|
7
7
|
import DataTableContext from './DataTableContext';
|
|
8
8
|
import Icon from '../Icon';
|
|
9
9
|
import IconButton from '../IconButton';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import DataTableContext from './DataTableContext';
|
|
3
3
|
import { DropdownButton } from '../Dropdown';
|
|
4
|
-
import useWindowSize from '../hooks/
|
|
4
|
+
import useWindowSize from '../hooks/useWindowSizeHook';
|
|
5
5
|
import breakpoints from '../utils/breakpoints';
|
|
6
6
|
|
|
7
7
|
/** The first filter will be as an input, additional filters will be available in a dropdown. */
|
|
@@ -110,16 +110,11 @@ It displays the data provided by the `DataTableContext` as an html table.
|
|
|
110
110
|
</DataTable>
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
<PropsTable displayName="Table" content='The DataTable.Table component expects to receive a react-table instance from the DataTableContext.' />
|
|
114
|
-
|
|
115
113
|
## Table Subcomponents
|
|
116
114
|
|
|
117
115
|
Subcomponents of `DataTable.Table` can be used independently of the main component. They are designed for use with a `react-table` instance.
|
|
118
116
|
|
|
119
|
-
|
|
120
|
-
<PropsTable displayName="TableCell" />
|
|
121
|
-
<PropsTable displayName="TableHeaderCell" />
|
|
122
|
-
<PropsTable displayName="TableHeaderRow" />
|
|
117
|
+
See the available props of `<TableRow>`, `<TableCell>`, `<TableHeaderCell>`, and `<TableHeaderRow>` below.
|
|
123
118
|
|
|
124
119
|
## CardView and alternate table components
|
|
125
120
|
|
|
@@ -337,8 +332,6 @@ a responsive grid of cards.
|
|
|
337
332
|
The `CardComponent` prop on `CardView` represents a table row, and will receive the row that `react-table`
|
|
338
333
|
provides as props.
|
|
339
334
|
|
|
340
|
-
<PropsTable displayName="CardView" />
|
|
341
|
-
|
|
342
335
|
```jsx
|
|
343
336
|
const MiyazakiCard = ({ className, original }) => {
|
|
344
337
|
const { title, director, release_date } = original;
|
package/src/DataTable/index.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@import "variables";
|
|
2
3
|
|
|
3
4
|
.pgn__data-table-wrapper {
|
|
@@ -26,10 +27,10 @@
|
|
|
26
27
|
display: flex;
|
|
27
28
|
|
|
28
29
|
.pgn__datatable__visible-actions {
|
|
29
|
-
margin-inline-start:
|
|
30
|
+
margin-inline-start: map.get($spacers, 2);
|
|
30
31
|
|
|
31
32
|
.btn {
|
|
32
|
-
margin-inline-start:
|
|
33
|
+
margin-inline-start: map.get($spacers, 2);
|
|
33
34
|
|
|
34
35
|
&:first-child {
|
|
35
36
|
margin-inline-start: 0;
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
width: 100%;
|
|
58
59
|
display: flex;
|
|
59
60
|
align-items: center;
|
|
60
|
-
margin-top:
|
|
61
|
+
margin-top: map.get($spacers, 4);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
.pgn__icon-button-toggle__container {
|
|
@@ -97,18 +98,18 @@
|
|
|
97
98
|
border-radius: $border-radius;
|
|
98
99
|
box-shadow: $data-table-box-shadow;
|
|
99
100
|
padding: $data-table-padding-small;
|
|
100
|
-
margin-right:
|
|
101
|
+
margin-right: map.get($spacers, 4);
|
|
101
102
|
flex: 0 0 $data-table-layout-sidebar-width;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
.pgn__data-table-side-filters {
|
|
105
106
|
.pgn__data-table-side-filters-title {
|
|
106
|
-
margin-bottom:
|
|
107
|
+
margin-bottom: map.get($spacers, 3);
|
|
107
108
|
text-align: start;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
.pgn__data-table-side-filters-status {
|
|
111
|
-
margin-bottom:
|
|
112
|
+
margin-bottom: map.get($spacers, 2);
|
|
112
113
|
display: flex;
|
|
113
114
|
justify-content: flex-end;
|
|
114
115
|
}
|
|
@@ -175,7 +176,7 @@
|
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
.pgn__data-table-filters-breakout-filter {
|
|
178
|
-
margin-inline-end:
|
|
179
|
+
margin-inline-end: map.get($spacers, 2);
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
.pgn__data-table-filters-dropdown-item {
|
|
@@ -264,12 +265,12 @@
|
|
|
264
265
|
padding: 0 $data-table-padding-x;
|
|
265
266
|
|
|
266
267
|
.pgn__data-table-card-view-default-skeleton-card-section {
|
|
267
|
-
margin-top:
|
|
268
|
+
margin-top: map.get($spacers, 2);
|
|
268
269
|
}
|
|
269
270
|
}
|
|
270
271
|
|
|
271
272
|
.pgn__data-table__action-btn {
|
|
272
|
-
margin-left:
|
|
273
|
+
margin-left: map.get($spacers, 2);
|
|
273
274
|
|
|
274
275
|
&:first-child {
|
|
275
276
|
margin-left: 0;
|
|
@@ -287,7 +288,7 @@
|
|
|
287
288
|
|
|
288
289
|
.pgn__datatable__overflow-actions-menu {
|
|
289
290
|
background: #FFFFFF;
|
|
290
|
-
padding:
|
|
291
|
+
padding: map.get($spacers, 2);
|
|
291
292
|
box-shadow: $level-1-box-shadow;
|
|
292
293
|
border-radius: 4px;
|
|
293
294
|
}
|
|
@@ -309,10 +310,10 @@
|
|
|
309
310
|
|
|
310
311
|
&.selection-right {
|
|
311
312
|
> :first-child {
|
|
312
|
-
margin-right:
|
|
313
|
+
margin-right: map.get($spacers, 2);
|
|
313
314
|
|
|
314
315
|
[dir="rtl"] & {
|
|
315
|
-
margin-left:
|
|
316
|
+
margin-left: map.get($spacers, 2);
|
|
316
317
|
margin-right: 0;
|
|
317
318
|
}
|
|
318
319
|
}
|
|
@@ -326,5 +327,5 @@
|
|
|
326
327
|
.pgn__data-table__controlled-select {
|
|
327
328
|
display: flex;
|
|
328
329
|
align-content: center;
|
|
329
|
-
padding:
|
|
330
|
+
padding: map.get($spacers, 1);
|
|
330
331
|
}
|
|
@@ -42,7 +42,8 @@ describe('<ControlledSelectHeader />', () => {
|
|
|
42
42
|
jest.resetAllMocks();
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
it('correctly selects all page rows', () => {
|
|
45
|
+
it('correctly selects all page rows', async () => {
|
|
46
|
+
const user = userEvent.setup();
|
|
46
47
|
const isChecked = true;
|
|
47
48
|
mockToggleAllPageRowsSelectedProps.mockReturnValue({
|
|
48
49
|
checked: isChecked,
|
|
@@ -53,13 +54,14 @@ describe('<ControlledSelectHeader />', () => {
|
|
|
53
54
|
render(<ControlledSelectHeaderWrapper tableProps={tableProps} selectProps={selectProps} />);
|
|
54
55
|
|
|
55
56
|
const checkbox = screen.getByRole('checkbox');
|
|
56
|
-
|
|
57
|
+
await user.click(checkbox);
|
|
57
58
|
|
|
58
59
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
59
60
|
expect(spy).toHaveBeenCalledWith(rows, tableProps.itemCount);
|
|
60
61
|
});
|
|
61
62
|
|
|
62
|
-
it('correctly unselects all page rows', () => {
|
|
63
|
+
it('correctly unselects all page rows', async () => {
|
|
64
|
+
const user = userEvent.setup();
|
|
63
65
|
const spy = jest.spyOn(selectActions, 'clearPageSelectionAction');
|
|
64
66
|
mockToggleAllPageRowsSelectedProps.mockReturnValue({
|
|
65
67
|
checked: false,
|
|
@@ -78,7 +80,7 @@ describe('<ControlledSelectHeader />', () => {
|
|
|
78
80
|
render(<ControlledSelectHeaderWrapper tableProps={newTableProps} selectProps={selectProps} />);
|
|
79
81
|
|
|
80
82
|
const checkbox = screen.getByRole('checkbox');
|
|
81
|
-
|
|
83
|
+
await user.click(checkbox);
|
|
82
84
|
|
|
83
85
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
84
86
|
const rowIds = getRowIds(rows).map(id => id.toString());
|
|
@@ -10,9 +10,8 @@ import {
|
|
|
10
10
|
} from '../CollapsibleButtonGroup';
|
|
11
11
|
import { useWindowSize, Button } from '../..';
|
|
12
12
|
import DataTableContext from '../DataTableContext';
|
|
13
|
-
import { waitForComponentToPaint } from './utils';
|
|
14
13
|
|
|
15
|
-
jest.mock('../../hooks/
|
|
14
|
+
jest.mock('../../hooks/useWindowSizeHook');
|
|
16
15
|
useWindowSize.mockReturnValue({ width: 800 });
|
|
17
16
|
|
|
18
17
|
const FIRST_ACTION = 'First Action';
|
|
@@ -199,8 +198,7 @@ describe('<BulkActions />', () => {
|
|
|
199
198
|
});
|
|
200
199
|
|
|
201
200
|
it('displays the user\'s second button as an outline button', () => {
|
|
202
|
-
|
|
203
|
-
waitForComponentToPaint(container);
|
|
201
|
+
render(<BulkActionsWrapper />);
|
|
204
202
|
const buttons = screen.getAllByTestId('action');
|
|
205
203
|
expect(buttons[0].textContent).toBe(SECOND_ACTION);
|
|
206
204
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { act } from 'react-dom/test-utils';
|
|
4
3
|
|
|
5
4
|
import userEvent from '@testing-library/user-event';
|
|
6
5
|
import DataTableContext from '../DataTableContext';
|
|
@@ -78,6 +77,7 @@ describe('data view toggle behavior', () => {
|
|
|
78
77
|
});
|
|
79
78
|
|
|
80
79
|
test('onDataViewToggle is invoked when clicking on buttons', async () => {
|
|
80
|
+
const user = userEvent.setup();
|
|
81
81
|
const onDataViewToggle = jest.fn();
|
|
82
82
|
render(
|
|
83
83
|
<DataTableContext.Provider
|
|
@@ -95,15 +95,11 @@ describe('data view toggle behavior', () => {
|
|
|
95
95
|
);
|
|
96
96
|
expect(screen.queryByRole('group')).toBeInTheDocument();
|
|
97
97
|
const cardButton = screen.getByLabelText(DATA_VIEW_TOGGLE_VALUES.card.alt);
|
|
98
|
-
await
|
|
99
|
-
userEvent.click(cardButton);
|
|
100
|
-
});
|
|
98
|
+
await user.click(cardButton);
|
|
101
99
|
expect(onDataViewToggle).toHaveBeenCalledWith(DATA_VIEW_TOGGLE_VALUES.card.value);
|
|
102
100
|
|
|
103
101
|
const listButton = screen.getByLabelText(DATA_VIEW_TOGGLE_VALUES.list.alt);
|
|
104
|
-
await
|
|
105
|
-
userEvent.click(listButton);
|
|
106
|
-
});
|
|
102
|
+
await user.click(listButton);
|
|
107
103
|
expect(onDataViewToggle).toHaveBeenCalledWith(DATA_VIEW_TOGGLE_VALUES.list.value);
|
|
108
104
|
});
|
|
109
105
|
});
|
|
@@ -6,7 +6,7 @@ import DropdownFilters from '../DropdownFilters';
|
|
|
6
6
|
import { useWindowSize } from '../..';
|
|
7
7
|
import DataTableContext from '../DataTableContext';
|
|
8
8
|
|
|
9
|
-
jest.mock('../../hooks/
|
|
9
|
+
jest.mock('../../hooks/useWindowSizeHook');
|
|
10
10
|
|
|
11
11
|
const instance = {
|
|
12
12
|
columns: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:color";
|
|
1
2
|
// Dropdowns
|
|
2
3
|
//
|
|
3
4
|
// Dropdown menu container and contents.
|
|
@@ -18,7 +19,7 @@ $dropdown-divider-margin-y: calc($spacer / 2) !default;
|
|
|
18
19
|
$dropdown-box-shadow: 0 .5rem 1rem rgba($black, .175) !default;
|
|
19
20
|
|
|
20
21
|
$dropdown-link-color: theme-color("gray", "dark-text") !default;
|
|
21
|
-
$dropdown-link-hover-color:
|
|
22
|
+
$dropdown-link-hover-color: color.adjust(theme-color("gray", "dark-text"), $lightness: -5%) !default;
|
|
22
23
|
$dropdown-link-hover-bg: $light-300 !default;
|
|
23
24
|
|
|
24
25
|
$dropdown-link-active-color: $component-active-color !default;
|
|
@@ -62,37 +62,43 @@ describe('<Dropdown />', () => {
|
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
it('opens on trigger click', async () => {
|
|
65
|
-
|
|
65
|
+
const user = userEvent.setup();
|
|
66
|
+
await user.click(wrapper.getByRole('button', { name: 'Search Engines' }));
|
|
66
67
|
menuOpen(true, wrapper);
|
|
67
68
|
});
|
|
68
69
|
|
|
69
70
|
it('should focus on the first item after opening', async () => {
|
|
70
|
-
|
|
71
|
+
const user = userEvent.setup();
|
|
72
|
+
await user.click(wrapper.getByRole('button', { name: 'Search Engines' }));
|
|
71
73
|
expect(wrapper.getByText('Google')).toHaveFocus();
|
|
72
74
|
});
|
|
73
75
|
|
|
74
76
|
it('does not close on click inside the menu', async () => {
|
|
75
|
-
|
|
76
|
-
await
|
|
77
|
+
const user = userEvent.setup();
|
|
78
|
+
await user.click(wrapper.getByRole('button', { name: 'Search Engines' }));
|
|
79
|
+
await user.click(wrapper.getByText('Google')); // Do nothing
|
|
77
80
|
menuOpen(true, wrapper);
|
|
78
81
|
});
|
|
79
82
|
|
|
80
83
|
it('closes on trigger click', async () => {
|
|
81
|
-
|
|
82
|
-
await
|
|
84
|
+
const user = userEvent.setup();
|
|
85
|
+
await user.click(wrapper.getByRole('button', { name: 'Search Engines' }));
|
|
86
|
+
await user.click(wrapper.getByRole('button', { name: 'Search Engines' })); // Close
|
|
83
87
|
menuOpen(false, wrapper);
|
|
84
88
|
});
|
|
85
89
|
|
|
86
90
|
it('should focus on the trigger button after closing', async () => {
|
|
87
|
-
|
|
88
|
-
await
|
|
91
|
+
const user = userEvent.setup();
|
|
92
|
+
await user.click(wrapper.getByRole('button', { name: 'Search Engines' }));
|
|
93
|
+
await user.click(wrapper.getByRole('button', { name: 'Search Engines' })); // Close
|
|
89
94
|
expect(wrapper.getByRole('button', { name: 'Search Engines' })).toHaveFocus();
|
|
90
95
|
});
|
|
91
96
|
|
|
92
97
|
it('closes on document click when open', async () => {
|
|
93
|
-
|
|
98
|
+
const user = userEvent.setup();
|
|
99
|
+
await user.click(wrapper.getByRole('button', { name: 'Search Engines' }));
|
|
94
100
|
menuOpen(true, wrapper);
|
|
95
|
-
document.
|
|
101
|
+
await user.click(document.body);
|
|
96
102
|
menuOpen(false, wrapper);
|
|
97
103
|
});
|
|
98
104
|
});
|
|
@@ -105,72 +111,82 @@ describe('<Dropdown />', () => {
|
|
|
105
111
|
});
|
|
106
112
|
|
|
107
113
|
it('opens on Enter keyDown', async () => {
|
|
114
|
+
const user = userEvent.setup();
|
|
108
115
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
109
|
-
await
|
|
116
|
+
await user.keyboard('{Enter}');
|
|
110
117
|
menuOpen(true, wrapper);
|
|
111
118
|
});
|
|
112
119
|
|
|
113
120
|
it('opens on Space keyDown', async () => {
|
|
121
|
+
const user = userEvent.setup();
|
|
114
122
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
115
|
-
await
|
|
123
|
+
await user.keyboard(' ');
|
|
116
124
|
menuOpen(true, wrapper);
|
|
117
125
|
});
|
|
118
126
|
|
|
119
127
|
it('should focus on the first item after opening', async () => {
|
|
128
|
+
const user = userEvent.setup();
|
|
120
129
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
121
|
-
await
|
|
130
|
+
await user.keyboard('{Enter}');
|
|
122
131
|
expect(wrapper.getByText('Google')).toHaveFocus();
|
|
123
132
|
});
|
|
124
133
|
|
|
125
134
|
it('should focus the next item after ArrowDown keyDown', async () => {
|
|
135
|
+
const user = userEvent.setup();
|
|
126
136
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
127
|
-
await
|
|
128
|
-
await
|
|
137
|
+
await user.keyboard('{Enter}');
|
|
138
|
+
await user.keyboard('{arrowdown}');
|
|
129
139
|
expect(wrapper.getByText('DuckDuckGo')).toHaveFocus();
|
|
130
140
|
});
|
|
131
141
|
|
|
132
142
|
it('should focus the next item after Tab keyDown', async () => {
|
|
143
|
+
const user = userEvent.setup();
|
|
133
144
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
134
|
-
await
|
|
135
|
-
await
|
|
145
|
+
await user.keyboard('{Enter}');
|
|
146
|
+
await user.tab();
|
|
136
147
|
expect(wrapper.getByText('DuckDuckGo')).toHaveFocus();
|
|
137
148
|
});
|
|
138
149
|
|
|
139
150
|
it('should loop focus to the first item after Tab keyDown on last item', async () => {
|
|
151
|
+
const user = userEvent.setup();
|
|
140
152
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
141
|
-
await
|
|
153
|
+
await user.keyboard('{Enter}');
|
|
142
154
|
wrapper.getByRole('link', { name: 'Yahoo' }).focus();
|
|
143
|
-
await
|
|
155
|
+
await user.tab();
|
|
144
156
|
expect(wrapper.getByText('Google')).toHaveFocus();
|
|
145
157
|
});
|
|
146
158
|
|
|
147
159
|
it('should loop focus to the last item after ArrowUp keyDown on first item', async () => {
|
|
160
|
+
const user = userEvent.setup();
|
|
148
161
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
149
|
-
await
|
|
162
|
+
await user.keyboard('{Enter}');
|
|
150
163
|
wrapper.getByRole('link', { name: 'Google' }).focus();
|
|
151
|
-
await
|
|
164
|
+
await user.keyboard('{arrowup}');
|
|
152
165
|
expect(wrapper.getByText('Yahoo')).toHaveFocus();
|
|
153
166
|
});
|
|
154
167
|
|
|
155
168
|
it('should focus the previous item after Shift + Tab keyDown', async () => {
|
|
169
|
+
const user = userEvent.setup();
|
|
156
170
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
157
|
-
await
|
|
171
|
+
await user.keyboard('{Enter}');
|
|
158
172
|
wrapper.getByRole('link', { name: 'Yahoo' }).focus();
|
|
159
|
-
await
|
|
173
|
+
await user.keyboard('{Shift>}{Tab}');
|
|
160
174
|
expect(wrapper.getByText('DuckDuckGo')).toHaveFocus();
|
|
161
175
|
});
|
|
162
176
|
|
|
163
177
|
it('should close the menu on Escape keyDown', async () => {
|
|
178
|
+
const user = userEvent.setup();
|
|
164
179
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
165
|
-
await
|
|
166
|
-
await
|
|
180
|
+
await user.keyboard('{Enter}');
|
|
181
|
+
await user.keyboard('{escape}');
|
|
167
182
|
menuOpen(false, wrapper);
|
|
168
183
|
});
|
|
169
184
|
|
|
170
185
|
it('should focus on the trigger button after closing', async () => {
|
|
186
|
+
const user = userEvent.setup();
|
|
171
187
|
wrapper.getByRole('button', { name: 'Search Engines' }).focus();
|
|
172
|
-
await
|
|
173
|
-
await
|
|
188
|
+
await user.keyboard('{Enter}');
|
|
189
|
+
await user.keyboard('{escape}');
|
|
174
190
|
expect(wrapper.getByRole('button', { name: 'Search Engines' })).toHaveFocus();
|
|
175
191
|
});
|
|
176
192
|
});
|
package/src/Dropzone/README.md
CHANGED
|
@@ -15,9 +15,9 @@ The `Dropzone` allows users to upload files via drag and drop, or by clicking th
|
|
|
15
15
|
|
|
16
16
|
You will also need to provide upload logic yourself via `onProcessUpload` prop which accepts function that should take care of uploading the file to the backend (i.e. send HTTP request).
|
|
17
17
|
This function accepts an object with following content as its only argument:
|
|
18
|
-
- {object} fileData - Metadata about the uploaded file.
|
|
19
|
-
- {object} requestConfig - Config to pass to `axios` call (this is required to display progress bar and hande cancel action).
|
|
20
|
-
- {function} handleError - Function to communicate to `Dropzone` that file upload resulted in failure, expects `Error` object as its only argument.
|
|
18
|
+
- \{object\} fileData - Metadata about the uploaded file.
|
|
19
|
+
- \{object\} requestConfig - Config to pass to `axios` call (this is required to display progress bar and hande cancel action).
|
|
20
|
+
- \{function\} handleError - Function to communicate to `Dropzone` that file upload resulted in failure, expects `Error` object as its only argument.
|
|
21
21
|
|
|
22
22
|
Each example below implements such a function.
|
|
23
23
|
|
package/src/Dropzone/index.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
@import "variables";
|
|
2
3
|
|
|
3
4
|
.pgn__dropzone {
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
|
|
42
43
|
.pgn__dropzone-generic-alert {
|
|
43
44
|
width: 100%;
|
|
44
|
-
margin-bottom:
|
|
45
|
+
margin-bottom: map.get($spacers, 4);
|
|
45
46
|
|
|
46
47
|
.pgn__alert-message-wrapper .alert-message-content {
|
|
47
48
|
> span {
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
background: $light-300;
|
|
57
58
|
border-radius: 50%;
|
|
58
59
|
position: relative;
|
|
59
|
-
margin-bottom: map
|
|
60
|
+
margin-bottom: map.get($spacers, 4);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
.pgn__dropzone__upload-icon {
|
|
@@ -21,7 +21,16 @@ exports[`<Dropzone /> successfully renders 1`] = `
|
|
|
21
21
|
onClick={[Function]}
|
|
22
22
|
style={
|
|
23
23
|
{
|
|
24
|
-
"
|
|
24
|
+
"border": 0,
|
|
25
|
+
"clip": "rect(0, 0, 0, 0)",
|
|
26
|
+
"clipPath": "inset(50%)",
|
|
27
|
+
"height": "1px",
|
|
28
|
+
"margin": "0 -1px -1px 0",
|
|
29
|
+
"overflow": "hidden",
|
|
30
|
+
"padding": 0,
|
|
31
|
+
"position": "absolute",
|
|
32
|
+
"whiteSpace": "nowrap",
|
|
33
|
+
"width": "1px",
|
|
25
34
|
}
|
|
26
35
|
}
|
|
27
36
|
tabIndex={-1}
|
|
@@ -12,7 +12,7 @@ import FormControl from './FormControl';
|
|
|
12
12
|
import FormControlFeedback from './FormControlFeedback';
|
|
13
13
|
import IconButton from '../IconButton';
|
|
14
14
|
import Spinner from '../Spinner';
|
|
15
|
-
import useArrowKeyNavigation from '../hooks/
|
|
15
|
+
import useArrowKeyNavigation from '../hooks/useArrowKeyNavigationHook';
|
|
16
16
|
import messages from './messages';
|
|
17
17
|
|
|
18
18
|
const FormAutosuggest = forwardRef(
|
|
@@ -60,7 +60,7 @@ function FormGroupContextProvider({
|
|
|
60
60
|
const [labelledByIds, registerLabelerId] = useIdList(controlId);
|
|
61
61
|
const [isControlGroup, useSetIsControlGroupEffect] = useStateEffect(false);
|
|
62
62
|
|
|
63
|
-
const getControlProps = useCallback((controlProps) => {
|
|
63
|
+
const getControlProps = useCallback((controlProps: Record<string, any>) => {
|
|
64
64
|
// labelledByIds from the list above should only be added to a control
|
|
65
65
|
// if it the control is a group. We prefer adding a condition here because:
|
|
66
66
|
// - Hooks cannot be called inside conditionals
|