@onewelcome/react-lib-components 0.2.1 → 0.2.2
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/Breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/dist/Button/BaseButton.d.ts +4 -4
- package/dist/Button/Button.d.ts +3 -3
- package/dist/Button/IconButton.d.ts +4 -4
- package/dist/ContextMenu/ContextMenu.d.ts +5 -5
- package/dist/ContextMenu/ContextMenuItem.d.ts +2 -2
- package/dist/DataGrid/DataGrid.d.ts +6 -6
- package/dist/DataGrid/DataGridActions/DataGridActions.d.ts +4 -4
- package/dist/DataGrid/DataGridActions/DataGridColumnsToggle.d.ts +3 -3
- package/dist/DataGrid/DataGridBody/DataGridBody.d.ts +3 -3
- package/dist/DataGrid/DataGridBody/DataGridCell.d.ts +2 -2
- package/dist/DataGrid/DataGridBody/DataGridRow.d.ts +3 -3
- package/dist/DataGrid/DataGridHeader/DataGridHeader.d.ts +3 -3
- package/dist/DataGrid/DataGridHeader/DataGridHeaderCell.d.ts +3 -3
- package/dist/DataGrid/datagrid.interfaces.d.ts +1 -1
- package/dist/Form/Checkbox/Checkbox.d.ts +5 -5
- package/dist/Form/Fieldset/Fieldset.d.ts +3 -3
- package/dist/Form/Form.d.ts +1 -1
- package/dist/Form/FormControl/FormControl.d.ts +3 -3
- package/dist/Form/FormGroup/FormGroup.d.ts +5 -5
- package/dist/Form/FormHelperText/FormHelperText.d.ts +3 -3
- package/dist/Form/FormSelectorWrapper/FormSelectorWrapper.d.ts +6 -6
- package/dist/Form/Input/Input.d.ts +5 -5
- package/dist/Form/Label/Label.d.ts +2 -2
- package/dist/Form/Radio/Radio.d.ts +5 -5
- package/dist/Form/Select/Option.d.ts +2 -2
- package/dist/Form/Select/Select.d.ts +5 -5
- package/dist/Form/Textarea/Textarea.d.ts +6 -6
- package/dist/Form/Toggle/Toggle.d.ts +3 -3
- package/dist/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.d.ts +4 -4
- package/dist/Form/Wrapper/InputWrapper/InputWrapper.d.ts +4 -4
- package/dist/Form/Wrapper/RadioWrapper/RadioWrapper.d.ts +4 -4
- package/dist/Form/Wrapper/SelectWrapper/SelectWrapper.d.ts +4 -4
- package/dist/Form/Wrapper/TextareaWrapper/TextareaWrapper.d.ts +4 -4
- package/dist/Form/Wrapper/Wrapper/Wrapper.d.ts +6 -6
- package/dist/Form/form.interfaces.d.ts +1 -1
- package/dist/Icon/Icon.d.ts +3 -3
- package/dist/Link/Link.d.ts +7 -7
- package/dist/Notifications/BaseModal/BaseModal.d.ts +4 -4
- package/dist/Notifications/BaseModal/BaseModalActions/BaseModalActions.d.ts +2 -2
- package/dist/Notifications/BaseModal/BaseModalContent/BaseModalContent.d.ts +2 -2
- package/dist/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.d.ts +2 -2
- package/dist/Notifications/Dialog/Dialog.d.ts +5 -5
- package/dist/Notifications/Dialog/DialogActions/DialogActions.d.ts +3 -3
- package/dist/Notifications/Dialog/DialogTitle/DialogTitle.d.ts +2 -2
- package/dist/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.d.ts +3 -3
- package/dist/Notifications/DiscardChangesModal/DiscardChangesModal.d.ts +7 -7
- package/dist/Notifications/Modal/Modal.d.ts +1 -1
- package/dist/Notifications/Modal/ModalActions/ModalActions.d.ts +1 -1
- package/dist/Notifications/Modal/ModalContent/ModalContent.d.ts +1 -1
- package/dist/Notifications/Modal/ModalHeader/ModalHeader.d.ts +1 -1
- package/dist/Notifications/SlideInModal/SlideInModal.d.ts +3 -3
- package/dist/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +3 -3
- package/dist/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +2 -2
- package/dist/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +3 -3
- package/dist/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +2 -2
- package/dist/Notifications/Snackbar/interfaces.d.ts +2 -2
- package/dist/Pagination/Pagination.d.ts +3 -3
- package/dist/Popover/Popover.d.ts +3 -3
- package/dist/Skeleton/Skeleton.d.ts +3 -3
- package/dist/StatusIndicator/StatusIndicator.d.ts +5 -5
- package/dist/Tabs/Tab.d.ts +1 -1
- package/dist/Tabs/TabButton.d.ts +2 -2
- package/dist/Tabs/TabPanel.d.ts +2 -2
- package/dist/Tabs/Tabs.d.ts +4 -4
- package/dist/TextEllipsis/TextEllipsis.d.ts +2 -2
- package/dist/Tiles/Tile.d.ts +5 -5
- package/dist/Tiles/Tiles.d.ts +2 -2
- package/dist/Tooltip/Tooltip.d.ts +3 -3
- package/dist/Typography/Typography.d.ts +3 -3
- package/dist/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +2 -2
- package/dist/Wizard/Wizard.d.ts +3 -3
- package/dist/Wizard/WizardActions/WizardActions.d.ts +2 -2
- package/dist/Wizard/WizardStateProvider.d.ts +2 -2
- package/dist/Wizard/WizardSteps/WizardSteps.d.ts +2 -2
- package/dist/Wizard/wizardStateReducer.d.ts +5 -5
- package/dist/_BaseStyling_/BaseStyling.d.ts +1 -1
- package/dist/hooks/usePosition.d.ts +4 -4
- package/dist/hooks/useRepeater.d.ts +1 -1
- package/dist/hooks/useScroll.d.ts +1 -1
- package/dist/hooks/useSpacing.d.ts +1 -1
- package/dist/hooks/useWrapper.d.ts +1 -1
- package/dist/index.d.ts +55 -55
- package/dist/react-lib-components.cjs.development.js +672 -576
- package/dist/react-lib-components.cjs.development.js.map +1 -1
- package/dist/react-lib-components.cjs.production.min.js +1 -1
- package/dist/react-lib-components.cjs.production.min.js.map +1 -1
- package/dist/react-lib-components.esm.js +672 -576
- package/dist/react-lib-components.esm.js.map +1 -1
- package/package.json +27 -16
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +15 -15
- package/src/Breadcrumbs/Breadcrumbs.tsx +11 -11
- package/src/Button/BaseButton.module.scss +1 -1
- package/src/Button/BaseButton.test.tsx +27 -27
- package/src/Button/BaseButton.tsx +8 -8
- package/src/Button/Button.module.scss +5 -5
- package/src/Button/Button.test.tsx +39 -39
- package/src/Button/Button.tsx +10 -10
- package/src/Button/IconButton.module.scss +5 -5
- package/src/Button/IconButton.test.tsx +29 -29
- package/src/Button/IconButton.tsx +11 -11
- package/src/ContextMenu/ContextMenu.test.tsx +81 -76
- package/src/ContextMenu/ContextMenu.tsx +43 -41
- package/src/ContextMenu/ContextMenuItem.module.scss +1 -1
- package/src/ContextMenu/ContextMenuItem.tsx +5 -5
- package/src/DataGrid/DataGrid.test.tsx +193 -193
- package/src/DataGrid/DataGrid.tsx +26 -26
- package/src/DataGrid/DataGridActions/DataGridActions.test.tsx +63 -63
- package/src/DataGrid/DataGridActions/DataGridActions.tsx +15 -15
- package/src/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss +1 -1
- package/src/DataGrid/DataGridActions/DataGridColumnsToggle.test.tsx +21 -21
- package/src/DataGrid/DataGridActions/DataGridColumnsToggle.tsx +20 -20
- package/src/DataGrid/DataGridBody/DataGridBody.test.tsx +40 -40
- package/src/DataGrid/DataGridBody/DataGridBody.tsx +10 -10
- package/src/DataGrid/DataGridBody/DataGridCell.module.scss +1 -1
- package/src/DataGrid/DataGridBody/DataGridCell.test.tsx +25 -25
- package/src/DataGrid/DataGridBody/DataGridCell.tsx +6 -6
- package/src/DataGrid/DataGridBody/DataGridRow.test.tsx +38 -38
- package/src/DataGrid/DataGridBody/DataGridRow.tsx +8 -8
- package/src/DataGrid/DataGridHeader/DataGridHeader.module.scss +1 -2
- package/src/DataGrid/DataGridHeader/DataGridHeader.test.tsx +119 -119
- package/src/DataGrid/DataGridHeader/DataGridHeader.tsx +13 -13
- package/src/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss +2 -0
- package/src/DataGrid/DataGridHeader/DataGridHeaderCell.test.tsx +51 -51
- package/src/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +14 -14
- package/src/DataGrid/datagrid.interfaces.ts +1 -1
- package/src/Form/Checkbox/Checkbox.test.tsx +74 -74
- package/src/Form/Checkbox/Checkbox.tsx +27 -27
- package/src/Form/Fieldset/Fieldset.module.scss +1 -1
- package/src/Form/Fieldset/Fieldset.test.tsx +35 -35
- package/src/Form/Fieldset/Fieldset.tsx +27 -27
- package/src/Form/Form.test.tsx +18 -18
- package/src/Form/Form.tsx +3 -3
- package/src/Form/FormControl/FormControl.test.tsx +22 -22
- package/src/Form/FormControl/FormControl.tsx +10 -10
- package/src/Form/FormGroup/FormGroup.test.tsx +37 -37
- package/src/Form/FormGroup/FormGroup.tsx +16 -16
- package/src/Form/FormHelperText/FormHelperText.test.tsx +18 -18
- package/src/Form/FormHelperText/FormHelperText.tsx +7 -7
- package/src/Form/FormSelectorWrapper/FormSelectorWrapper.test.tsx +15 -15
- package/src/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +14 -14
- package/src/Form/Input/Input.module.scss +20 -44
- package/src/Form/Input/Input.test.tsx +86 -59
- package/src/Form/Input/Input.tsx +96 -35
- package/src/Form/Label/Label.test.tsx +13 -13
- package/src/Form/Label/Label.tsx +6 -6
- package/src/Form/Radio/Radio.test.tsx +35 -35
- package/src/Form/Radio/Radio.tsx +17 -17
- package/src/Form/Select/Option.test.tsx +10 -10
- package/src/Form/Select/Option.tsx +8 -8
- package/src/Form/Select/Select.module.scss +7 -9
- package/src/Form/Select/Select.test.tsx +144 -141
- package/src/Form/Select/Select.tsx +79 -78
- package/src/Form/Textarea/Textarea.module.scss +8 -18
- package/src/Form/Textarea/Textarea.test.tsx +27 -27
- package/src/Form/Textarea/Textarea.tsx +33 -13
- package/src/Form/Toggle/Toggle.module.scss +1 -1
- package/src/Form/Toggle/Toggle.test.tsx +22 -22
- package/src/Form/Toggle/Toggle.tsx +10 -10
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.tsx +39 -39
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.tsx +12 -12
- package/src/Form/Wrapper/InputWrapper/InputWrapper.module.scss +2 -8
- package/src/Form/Wrapper/InputWrapper/InputWrapper.test.tsx +55 -55
- package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +30 -35
- package/src/Form/Wrapper/RadioWrapper/RadioWrapper.test.tsx +35 -35
- package/src/Form/Wrapper/RadioWrapper/RadioWrapper.tsx +12 -12
- package/src/Form/Wrapper/SelectWrapper/SelectWrapper.test.tsx +55 -55
- package/src/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +12 -12
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss +2 -11
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.test.tsx +50 -50
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +22 -22
- package/src/Form/Wrapper/Wrapper/Wrapper.module.scss +2 -2
- package/src/Form/Wrapper/Wrapper/Wrapper.test.tsx +11 -11
- package/src/Form/Wrapper/Wrapper/Wrapper.tsx +17 -17
- package/src/Form/form.interfaces.ts +1 -1
- package/src/Icon/Icon.module.scss +71 -71
- package/src/Icon/Icon.test.tsx +18 -18
- package/src/Icon/Icon.tsx +70 -70
- package/src/Link/Link.module.scss +5 -5
- package/src/Link/Link.test.tsx +76 -76
- package/src/Link/Link.tsx +27 -27
- package/src/Link/types.d.ts +1 -1
- package/src/Notifications/BaseModal/BaseModal.module.scss +1 -1
- package/src/Notifications/BaseModal/BaseModal.test.tsx +53 -53
- package/src/Notifications/BaseModal/BaseModal.tsx +16 -16
- package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.test.tsx +13 -13
- package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.tsx +5 -5
- package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.test.tsx +16 -16
- package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.tsx +5 -5
- package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.test.tsx +19 -19
- package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.tsx +10 -10
- package/src/Notifications/Dialog/Dialog.test.tsx +35 -35
- package/src/Notifications/Dialog/Dialog.tsx +19 -19
- package/src/Notifications/Dialog/DialogActions/DialogActions.test.tsx +14 -14
- package/src/Notifications/Dialog/DialogActions/DialogActions.tsx +6 -6
- package/src/Notifications/Dialog/DialogTitle/DialogTitle.test.tsx +12 -12
- package/src/Notifications/Dialog/DialogTitle/DialogTitle.tsx +6 -6
- package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.test.tsx +20 -20
- package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.tsx +7 -7
- package/src/Notifications/DiscardChangesModal/DiscardChangesModal.test.tsx +36 -36
- package/src/Notifications/DiscardChangesModal/DiscardChangesModal.tsx +8 -8
- package/src/Notifications/Modal/Modal.test.tsx +6 -6
- package/src/Notifications/Modal/Modal.tsx +1 -1
- package/src/Notifications/Modal/ModalActions/ModalActions.tsx +2 -2
- package/src/Notifications/Modal/ModalContent/ModalContent.tsx +2 -2
- package/src/Notifications/Modal/ModalHeader/ModalHeader.tsx +2 -2
- package/src/Notifications/SlideInModal/SlideInModal.test.tsx +16 -16
- package/src/Notifications/SlideInModal/SlideInModal.tsx +16 -11
- package/src/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.tsx +16 -16
- package/src/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.tsx +6 -6
- package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +2 -2
- package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.tsx +17 -17
- package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +23 -23
- package/src/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.tsx +32 -32
- package/src/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +18 -18
- package/src/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +3 -3
- package/src/Notifications/Snackbar/interfaces.ts +2 -2
- package/src/Notifications/Snackbar/useSnackbar.ts +2 -2
- package/src/Pagination/Pagination.module.scss +2 -0
- package/src/Pagination/Pagination.test.tsx +47 -47
- package/src/Pagination/Pagination.tsx +35 -35
- package/src/Popover/Popover.test.tsx +19 -19
- package/src/Popover/Popover.tsx +7 -7
- package/src/Skeleton/Skeleton.module.scss +2 -2
- package/src/Skeleton/Skeleton.test.tsx +29 -29
- package/src/Skeleton/Skeleton.tsx +10 -10
- package/src/StatusIndicator/StatusIndicator.test.tsx +38 -38
- package/src/StatusIndicator/StatusIndicator.tsx +9 -9
- package/src/Tabs/Tab.test.tsx +13 -13
- package/src/Tabs/Tab.tsx +1 -1
- package/src/Tabs/TabButton.test.tsx +28 -28
- package/src/Tabs/TabButton.tsx +7 -7
- package/src/Tabs/TabPanel.test.tsx +30 -30
- package/src/Tabs/TabPanel.tsx +4 -4
- package/src/Tabs/Tabs.test.tsx +93 -93
- package/src/Tabs/Tabs.tsx +25 -25
- package/src/TextEllipsis/TextEllipsis.test.tsx +22 -22
- package/src/TextEllipsis/TextEllipsis.tsx +6 -6
- package/src/Tiles/Tile.module.scss +1 -1
- package/src/Tiles/Tile.test.tsx +42 -42
- package/src/Tiles/Tile.tsx +22 -22
- package/src/Tiles/Tiles.test.tsx +30 -30
- package/src/Tiles/Tiles.tsx +9 -9
- package/src/Tooltip/Tooltip.test.tsx +35 -35
- package/src/Tooltip/Tooltip.tsx +21 -21
- package/src/Typography/Typography.module.scss +1 -1
- package/src/Typography/Typography.test.tsx +49 -49
- package/src/Typography/Typography.tsx +42 -42
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.module.scss +1 -1
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.test.tsx +26 -26
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +24 -24
- package/src/Wizard/Wizard.test.tsx +56 -56
- package/src/Wizard/Wizard.tsx +6 -6
- package/src/Wizard/WizardActions/WizardActions.test.tsx +34 -34
- package/src/Wizard/WizardActions/WizardActions.tsx +14 -14
- package/src/Wizard/WizardStateProvider.tsx +3 -3
- package/src/Wizard/WizardSteps/WizardSteps.test.tsx +27 -27
- package/src/Wizard/WizardSteps/WizardSteps.tsx +7 -7
- package/src/Wizard/wizardStateReducer.ts +9 -9
- package/src/_BaseStyling_/BaseStyling.test.tsx +14 -14
- package/src/_BaseStyling_/BaseStyling.tsx +50 -50
- package/src/hooks/useAnimation.test.tsx +12 -12
- package/src/hooks/useAnimation.ts +4 -4
- package/src/hooks/useBodyClick.test.tsx +8 -8
- package/src/hooks/useBodyClick.ts +3 -3
- package/src/hooks/useFormSelector.test.ts +17 -17
- package/src/hooks/useFormSelector.ts +4 -4
- package/src/hooks/usePosition.test.tsx +215 -215
- package/src/hooks/usePosition.ts +68 -68
- package/src/hooks/useRepeater.test.tsx +26 -26
- package/src/hooks/useRepeater.ts +5 -5
- package/src/hooks/useScroll.test.tsx +5 -5
- package/src/hooks/useScroll.ts +3 -3
- package/src/hooks/useSpacing.test.ts +40 -40
- package/src/hooks/useSpacing.ts +3 -3
- package/src/hooks/useWrapper.test.ts +12 -12
- package/src/hooks/useWrapper.ts +10 -10
- package/src/index.ts +67 -67
- package/src/mixins.module.scss +76 -27
- package/src/types.d.ts +1 -1
- package/src/util/helper.test.tsx +25 -25
- package/src/util/helper.tsx +64 -64
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { renderHook, act } from
|
|
2
|
-
import { useWrapper } from
|
|
1
|
+
import { renderHook, act } from "@testing-library/react-hooks";
|
|
2
|
+
import { useWrapper } from "./useWrapper";
|
|
3
3
|
|
|
4
|
-
describe(
|
|
5
|
-
it(
|
|
6
|
-
const { result } = renderHook(() => useWrapper(
|
|
4
|
+
describe("it should give the correct results based on no value, no placeholder and default text input", () => {
|
|
5
|
+
it("should execute correctly", () => {
|
|
6
|
+
const { result } = renderHook(() => useWrapper("", undefined, "text"));
|
|
7
7
|
|
|
8
8
|
expect(result.current.helperId).toHaveLength(20);
|
|
9
9
|
expect(result.current.errorId).toHaveLength(20);
|
|
@@ -30,19 +30,19 @@ describe('it should give the correct results based on no value, no placeholder a
|
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
describe(
|
|
34
|
-
it(
|
|
35
|
-
const { result } = renderHook(() => useWrapper(
|
|
33
|
+
describe("it should have floating label active because of the value", () => {
|
|
34
|
+
it("should have active floating label state", () => {
|
|
35
|
+
const { result } = renderHook(() => useWrapper("value", undefined, "text"));
|
|
36
36
|
|
|
37
37
|
expect(result.current.floatingLabelActive).toBe(true);
|
|
38
38
|
});
|
|
39
|
-
it(
|
|
40
|
-
const { result } = renderHook(() => useWrapper(
|
|
39
|
+
it("should have floating label active because input type is datetime-local", () => {
|
|
40
|
+
const { result } = renderHook(() => useWrapper("", undefined, "datetime-local"));
|
|
41
41
|
|
|
42
42
|
expect(result.current.floatingLabelActive).toBe(true);
|
|
43
43
|
});
|
|
44
|
-
it(
|
|
45
|
-
const { result } = renderHook(() => useWrapper(
|
|
44
|
+
it("should have floating label active because of placeholder", () => {
|
|
45
|
+
const { result } = renderHook(() => useWrapper("", "placeholder", "text"));
|
|
46
46
|
|
|
47
47
|
expect(result.current.floatingLabelActive).toBe(true);
|
|
48
48
|
});
|
package/src/hooks/useWrapper.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useEffect, useState } from
|
|
2
|
-
import { generateID } from
|
|
3
|
-
import { Type as InputTypes } from
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { generateID } from "../util/helper";
|
|
3
|
+
import { Type as InputTypes } from "../Form/Input/Input";
|
|
4
4
|
|
|
5
5
|
export const useWrapper = (value?: string, placeholder?: string, type?: InputTypes) => {
|
|
6
6
|
const [helperId] = useState(generateID(20));
|
|
@@ -13,9 +13,9 @@ export const useWrapper = (value?: string, placeholder?: string, type?: InputTyp
|
|
|
13
13
|
if (
|
|
14
14
|
(value?.length && value.length > 0) ||
|
|
15
15
|
placeholder ||
|
|
16
|
-
type ===
|
|
17
|
-
type ===
|
|
18
|
-
type ===
|
|
16
|
+
type === "datetime-local" ||
|
|
17
|
+
type === "time" ||
|
|
18
|
+
type === "date"
|
|
19
19
|
) {
|
|
20
20
|
setFloatingLabelActive(true);
|
|
21
21
|
}
|
|
@@ -27,9 +27,9 @@ export const useWrapper = (value?: string, placeholder?: string, type?: InputTyp
|
|
|
27
27
|
} else if (
|
|
28
28
|
!placeholder &&
|
|
29
29
|
!hasFocus &&
|
|
30
|
-
type !==
|
|
31
|
-
type !==
|
|
32
|
-
type !==
|
|
30
|
+
type !== "datetime-local" &&
|
|
31
|
+
type !== "time" &&
|
|
32
|
+
type !== "date"
|
|
33
33
|
) {
|
|
34
34
|
setFloatingLabelActive(false);
|
|
35
35
|
}
|
|
@@ -42,6 +42,6 @@ export const useWrapper = (value?: string, placeholder?: string, type?: InputTyp
|
|
|
42
42
|
floatingLabelActive,
|
|
43
43
|
setFloatingLabelActive,
|
|
44
44
|
hasFocus,
|
|
45
|
-
setHasFocus
|
|
45
|
+
setHasFocus
|
|
46
46
|
};
|
|
47
47
|
};
|
package/src/index.ts
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
/* Components */
|
|
2
|
-
export { BaseStyling } from
|
|
3
|
-
export { Button, Props as ButtonProps } from
|
|
4
|
-
export { Breadcrumbs, Props as BreadcrumbsProps } from
|
|
5
|
-
export { ContextMenu, Props as ContextMenuProps } from
|
|
6
|
-
export { ContextMenuItem, Props as ContextMenuItemProps } from
|
|
7
|
-
export { Link, Props as LinkProps, AnchorType } from
|
|
8
|
-
export { Icon, Icons, Props as IconProps } from
|
|
9
|
-
export { IconButton, Props as IconButtonProps } from
|
|
10
|
-
export { Tab, Props as TabProps } from
|
|
11
|
-
export { Tabs, Props as TabsProps } from
|
|
12
|
-
export { TextEllipsis, Props as TextEllipsisProps } from
|
|
13
|
-
export { Tile, Props as TileProps } from
|
|
14
|
-
export { Tiles, Props as TilesProps } from
|
|
15
|
-
export { Tooltip, Props as TooltipProps } from
|
|
16
|
-
export { Typography, Variant, Props as TypographyProps } from
|
|
17
|
-
export { Skeleton, Props as SkeletonProps } from
|
|
18
|
-
export { StatusIndicator, Props as StatusIndicatorProps } from
|
|
2
|
+
export { BaseStyling } from "./_BaseStyling_/BaseStyling";
|
|
3
|
+
export { Button, Props as ButtonProps } from "./Button/Button";
|
|
4
|
+
export { Breadcrumbs, Props as BreadcrumbsProps } from "./Breadcrumbs/Breadcrumbs";
|
|
5
|
+
export { ContextMenu, Props as ContextMenuProps } from "./ContextMenu/ContextMenu";
|
|
6
|
+
export { ContextMenuItem, Props as ContextMenuItemProps } from "./ContextMenu/ContextMenuItem";
|
|
7
|
+
export { Link, Props as LinkProps, AnchorType } from "./Link/Link";
|
|
8
|
+
export { Icon, Icons, Props as IconProps } from "./Icon/Icon";
|
|
9
|
+
export { IconButton, Props as IconButtonProps } from "./Button/IconButton";
|
|
10
|
+
export { Tab, Props as TabProps } from "./Tabs/Tab";
|
|
11
|
+
export { Tabs, Props as TabsProps } from "./Tabs/Tabs";
|
|
12
|
+
export { TextEllipsis, Props as TextEllipsisProps } from "./TextEllipsis/TextEllipsis";
|
|
13
|
+
export { Tile, Props as TileProps } from "./Tiles/Tile";
|
|
14
|
+
export { Tiles, Props as TilesProps } from "./Tiles/Tiles";
|
|
15
|
+
export { Tooltip, Props as TooltipProps } from "./Tooltip/Tooltip";
|
|
16
|
+
export { Typography, Variant, Props as TypographyProps } from "./Typography/Typography";
|
|
17
|
+
export { Skeleton, Props as SkeletonProps } from "./Skeleton/Skeleton";
|
|
18
|
+
export { StatusIndicator, Props as StatusIndicatorProps } from "./StatusIndicator/StatusIndicator";
|
|
19
19
|
export {
|
|
20
20
|
Pagination,
|
|
21
21
|
Props as PaginationProps,
|
|
22
22
|
PageChangeLabels,
|
|
23
23
|
PaginationTranslations,
|
|
24
|
-
PageSize
|
|
25
|
-
} from
|
|
24
|
+
PageSize
|
|
25
|
+
} from "./Pagination/Pagination";
|
|
26
26
|
|
|
27
27
|
/* Utils */
|
|
28
|
-
export { useRepeater } from
|
|
29
|
-
export { generateID } from
|
|
28
|
+
export { useRepeater } from "./hooks/useRepeater";
|
|
29
|
+
export { generateID } from "./util/helper";
|
|
30
30
|
|
|
31
31
|
/* Notifications */
|
|
32
|
-
export { Modal, Props as ModalProps } from
|
|
33
|
-
export { useSnackbar } from
|
|
32
|
+
export { Modal, Props as ModalProps } from "./Notifications/Modal/Modal";
|
|
33
|
+
export { useSnackbar } from "./Notifications/Snackbar/useSnackbar";
|
|
34
34
|
export {
|
|
35
35
|
Dialog,
|
|
36
36
|
Props as DialogProps,
|
|
37
|
-
Action as DialogAction
|
|
38
|
-
} from
|
|
37
|
+
Action as DialogAction
|
|
38
|
+
} from "./Notifications/Dialog/Dialog";
|
|
39
39
|
export {
|
|
40
40
|
DiscardChangesModal,
|
|
41
|
-
Props as DiscardChangesModalProps
|
|
42
|
-
} from
|
|
41
|
+
Props as DiscardChangesModalProps
|
|
42
|
+
} from "./Notifications/DiscardChangesModal/DiscardChangesModal";
|
|
43
43
|
export {
|
|
44
44
|
ModalActions,
|
|
45
|
-
Props as ModalActionsProps
|
|
46
|
-
} from
|
|
45
|
+
Props as ModalActionsProps
|
|
46
|
+
} from "./Notifications/Modal/ModalActions/ModalActions";
|
|
47
47
|
export {
|
|
48
48
|
ModalContent,
|
|
49
|
-
Props as ModalContentProps
|
|
50
|
-
} from
|
|
49
|
+
Props as ModalContentProps
|
|
50
|
+
} from "./Notifications/Modal/ModalContent/ModalContent";
|
|
51
51
|
export {
|
|
52
52
|
ModalHeader,
|
|
53
|
-
Props as ModalHeaderProps
|
|
54
|
-
} from
|
|
53
|
+
Props as ModalHeaderProps
|
|
54
|
+
} from "./Notifications/Modal/ModalHeader/ModalHeader";
|
|
55
55
|
export {
|
|
56
56
|
SlideInModal,
|
|
57
|
-
Props as SlideInModalProps
|
|
58
|
-
} from
|
|
57
|
+
Props as SlideInModalProps
|
|
58
|
+
} from "./Notifications/SlideInModal/SlideInModal";
|
|
59
59
|
export {
|
|
60
60
|
SnackbarProvider,
|
|
61
|
-
Props as SnackbarProviderProps
|
|
62
|
-
} from
|
|
61
|
+
Props as SnackbarProviderProps
|
|
62
|
+
} from "./Notifications/Snackbar/SnackbarProvider/SnackbarProvider";
|
|
63
63
|
|
|
64
64
|
/** Form components */
|
|
65
|
-
export { Checkbox, Props as CheckboxProps } from
|
|
66
|
-
export { Fieldset, Props as FieldsetProps } from
|
|
67
|
-
export { Form, Props as FormProps } from
|
|
68
|
-
export { FormControl, Props as FormControlProps } from
|
|
69
|
-
export { FormGroup, Props as FormGroupProps } from
|
|
70
|
-
export { FormHelperText, Props as FormHelperTextProps } from
|
|
71
|
-
export { Input, Props as InputProps, Type as InputType } from
|
|
72
|
-
export { InputWrapper, Props as InputWrapperProps } from
|
|
73
|
-
export { Label, Props as LabelProps } from
|
|
74
|
-
export { Option, Props as OptionProps } from
|
|
75
|
-
export { Radio, Props as RadioProps } from
|
|
76
|
-
export { RadioWrapper, Props as RadioWrapperProps } from
|
|
77
|
-
export { Select, Props as SelectProps } from
|
|
78
|
-
export { Textarea, Props as TextareaProps } from
|
|
79
|
-
export { Toggle, Props as ToggleProps } from
|
|
65
|
+
export { Checkbox, Props as CheckboxProps } from "./Form/Checkbox/Checkbox";
|
|
66
|
+
export { Fieldset, Props as FieldsetProps } from "./Form/Fieldset/Fieldset";
|
|
67
|
+
export { Form, Props as FormProps } from "./Form/Form";
|
|
68
|
+
export { FormControl, Props as FormControlProps } from "./Form/FormControl/FormControl";
|
|
69
|
+
export { FormGroup, Props as FormGroupProps } from "./Form/FormGroup/FormGroup";
|
|
70
|
+
export { FormHelperText, Props as FormHelperTextProps } from "./Form/FormHelperText/FormHelperText";
|
|
71
|
+
export { Input, Props as InputProps, Type as InputType } from "./Form/Input/Input";
|
|
72
|
+
export { InputWrapper, Props as InputWrapperProps } from "./Form/Wrapper/InputWrapper/InputWrapper";
|
|
73
|
+
export { Label, Props as LabelProps } from "./Form/Label/Label";
|
|
74
|
+
export { Option, Props as OptionProps } from "./Form/Select/Option";
|
|
75
|
+
export { Radio, Props as RadioProps } from "./Form/Radio/Radio";
|
|
76
|
+
export { RadioWrapper, Props as RadioWrapperProps } from "./Form/Wrapper/RadioWrapper/RadioWrapper";
|
|
77
|
+
export { Select, Props as SelectProps } from "./Form/Select/Select";
|
|
78
|
+
export { Textarea, Props as TextareaProps } from "./Form/Textarea/Textarea";
|
|
79
|
+
export { Toggle, Props as ToggleProps } from "./Form/Toggle/Toggle";
|
|
80
80
|
export {
|
|
81
81
|
CheckboxWrapper,
|
|
82
|
-
Props as CheckboxWrapperProps
|
|
83
|
-
} from
|
|
82
|
+
Props as CheckboxWrapperProps
|
|
83
|
+
} from "./Form/Wrapper/CheckboxWrapper/CheckboxWrapper";
|
|
84
84
|
export {
|
|
85
85
|
TextareaWrapper,
|
|
86
|
-
Props as TextareaWrapperProps
|
|
87
|
-
} from
|
|
86
|
+
Props as TextareaWrapperProps
|
|
87
|
+
} from "./Form/Wrapper/TextareaWrapper/TextareaWrapper";
|
|
88
88
|
export {
|
|
89
89
|
SelectWrapper,
|
|
90
|
-
Props as SelectWrapperProps
|
|
91
|
-
} from
|
|
90
|
+
Props as SelectWrapperProps
|
|
91
|
+
} from "./Form/Wrapper/SelectWrapper/SelectWrapper";
|
|
92
92
|
|
|
93
93
|
/** Wizard */
|
|
94
|
-
export { Wizard, Props as WizardProps } from
|
|
95
|
-
export { WizardActions, Props as WizardActionsProps } from
|
|
96
|
-
export { WizardSteps, Props as WizardStepsProps } from
|
|
94
|
+
export { Wizard, Props as WizardProps } from "./Wizard/Wizard";
|
|
95
|
+
export { WizardActions, Props as WizardActionsProps } from "./Wizard/WizardActions/WizardActions";
|
|
96
|
+
export { WizardSteps, Props as WizardStepsProps } from "./Wizard/WizardSteps/WizardSteps";
|
|
97
97
|
export {
|
|
98
98
|
BaseWizardSteps,
|
|
99
99
|
Props as BaseWizardStepsProps,
|
|
100
|
-
Step as WizardStep
|
|
101
|
-
} from
|
|
100
|
+
Step as WizardStep
|
|
101
|
+
} from "./Wizard/BaseWizardSteps/BaseWizardSteps";
|
|
102
102
|
|
|
103
103
|
/** DataGrid */
|
|
104
|
-
export { HeaderCell } from
|
|
105
|
-
export { DataGrid, Props as DataGridProps } from
|
|
106
|
-
export { DataGridRow, Props as DataGridRowProps } from
|
|
107
|
-
export { DataGridCell, Props as DataGridCellProps } from
|
|
104
|
+
export { HeaderCell } from "./DataGrid/datagrid.interfaces";
|
|
105
|
+
export { DataGrid, Props as DataGridProps } from "./DataGrid/DataGrid";
|
|
106
|
+
export { DataGridRow, Props as DataGridRowProps } from "./DataGrid/DataGridBody/DataGridRow";
|
|
107
|
+
export { DataGridCell, Props as DataGridCellProps } from "./DataGrid/DataGridBody/DataGridCell";
|
package/src/mixins.module.scss
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import "./readyclasses.module.scss";
|
|
2
2
|
|
|
3
|
-
@mixin button($variant:
|
|
4
|
-
$disabledSelector: if($type ==
|
|
3
|
+
@mixin button($variant: "text", $type: "default") {
|
|
4
|
+
$disabledSelector: if($type == "link", ".disabled", ":disabled");
|
|
5
5
|
|
|
6
|
-
@if $variant ==
|
|
6
|
+
@if $variant == "text" {
|
|
7
7
|
border-color: transparent;
|
|
8
8
|
background-color: transparent;
|
|
9
|
-
} @else if $variant ==
|
|
10
|
-
@if $type ==
|
|
9
|
+
} @else if $variant == "fill" {
|
|
10
|
+
@if $type == "default" {
|
|
11
11
|
color: var(--button-fill-text-color);
|
|
12
|
-
} @else if $type ==
|
|
12
|
+
} @else if $type == "icon" or $type == "link" {
|
|
13
13
|
&:not(#{$disabledSelector}) {
|
|
14
14
|
color: var(--button-fill-text-color);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
font-weight: bold;
|
|
18
|
-
} @else if $variant ==
|
|
18
|
+
} @else if $variant == "outline" {
|
|
19
19
|
background-color: var(--button-fill-background-color);
|
|
20
20
|
font-weight: bold;
|
|
21
21
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
@include buttonStyles(var(--default), $variant, $type);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
@if $variant ==
|
|
36
|
+
@if $variant == "fill" {
|
|
37
37
|
&:hover:not(#{$disabledSelector}),
|
|
38
38
|
&:focus:not(#{$disabledSelector}),
|
|
39
39
|
&:active:not(#{$disabledSelector}) {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
background-color: var(--disabled);
|
|
45
45
|
border-color: var(--disabled);
|
|
46
46
|
}
|
|
47
|
-
} @else if $variant ==
|
|
47
|
+
} @else if $variant == "outline" {
|
|
48
48
|
&:hover:not(#{$disabledSelector}),
|
|
49
49
|
&:focus:not(#{$disabledSelector}) {
|
|
50
50
|
color: var(--button-outline-hover-text-color);
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
@mixin buttonStyles($color, $variant:
|
|
61
|
-
@if $variant ==
|
|
60
|
+
@mixin buttonStyles($color, $variant: "text", $type: "default") {
|
|
61
|
+
@if $variant == "text" {
|
|
62
62
|
color: $color;
|
|
63
|
-
} @else if $variant ==
|
|
63
|
+
} @else if $variant == "fill" {
|
|
64
64
|
border-color: $color;
|
|
65
65
|
background-color: $color;
|
|
66
|
-
} @else if $variant ==
|
|
66
|
+
} @else if $variant == "outline" {
|
|
67
67
|
border-color: $color;
|
|
68
68
|
color: $color;
|
|
69
69
|
}
|
|
@@ -72,39 +72,39 @@
|
|
|
72
72
|
|
|
73
73
|
&:hover:not(.disabled),
|
|
74
74
|
&:focus:not(.disabled) {
|
|
75
|
-
@if $variant ==
|
|
75
|
+
@if $variant == "text" {
|
|
76
76
|
border-color: $color;
|
|
77
|
-
} @else if $variant ==
|
|
77
|
+
} @else if $variant == "fill" {
|
|
78
78
|
color: $color;
|
|
79
|
-
} @else if $variant ==
|
|
79
|
+
} @else if $variant == "outline" {
|
|
80
80
|
background-color: $color;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
@if $variant ==
|
|
84
|
+
@if $variant == "text" or $variant == "fill" {
|
|
85
85
|
&:active:not(.disabled) {
|
|
86
|
-
@if $variant ==
|
|
86
|
+
@if $variant == "text" {
|
|
87
87
|
background-color: transparent;
|
|
88
88
|
position: relative;
|
|
89
89
|
color: $color;
|
|
90
90
|
border-color: var(--button-fill-background-color);
|
|
91
|
-
} @else if $variant ==
|
|
91
|
+
} @else if $variant == "fill" {
|
|
92
92
|
position: relative;
|
|
93
93
|
color: $color;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
&:after {
|
|
97
|
-
content:
|
|
97
|
+
content: "";
|
|
98
98
|
position: absolute;
|
|
99
|
-
@if $variant ==
|
|
99
|
+
@if $variant == "fill" {
|
|
100
100
|
top: calc(-1 * var(--button-border-width));
|
|
101
101
|
} @else {
|
|
102
102
|
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
103
103
|
}
|
|
104
|
-
@if $type ==
|
|
104
|
+
@if $type == "default" or $type == "link" {
|
|
105
105
|
left: 0;
|
|
106
106
|
width: 100%;
|
|
107
|
-
} @else if $type ==
|
|
107
|
+
} @else if $type == "icon" {
|
|
108
108
|
left: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
109
109
|
width: calc(100% + var(--button-border-width));
|
|
110
110
|
}
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
@mixin buttonBase($type:
|
|
121
|
-
$disabledSelector: if($type ==
|
|
120
|
+
@mixin buttonBase($type: "default") {
|
|
121
|
+
$disabledSelector: if($type == "link", ".disabled", ":disabled");
|
|
122
122
|
|
|
123
123
|
border-width: var(--button-border-width);
|
|
124
124
|
border-style: var(--button-border-style);
|
|
@@ -140,6 +140,55 @@
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
@mixin outline {
|
|
144
|
+
.outline {
|
|
145
|
+
pointer-events: none;
|
|
146
|
+
position: absolute;
|
|
147
|
+
margin: 0;
|
|
148
|
+
padding: 0;
|
|
149
|
+
inset: 0;
|
|
150
|
+
border-color: var(--input-border-color);
|
|
151
|
+
border-style: var(--input-border-style);
|
|
152
|
+
border-width: var(--input-border-width);
|
|
153
|
+
border-radius: var(--input-border-radius);
|
|
154
|
+
transition: all 0.2s ease-in-out;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@mixin outlineStates {
|
|
159
|
+
&:hover .outline {
|
|
160
|
+
border-color: var(--default);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.outline.disabled {
|
|
164
|
+
border-color: #fff;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.outline.error {
|
|
168
|
+
border-color: var(--error);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.outline.focus {
|
|
172
|
+
border-width: var(--input-border-width-focus);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.outline.focus:not(.error) {
|
|
176
|
+
border-color: var(--color-primary);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@mixin browserOutlineDisabled {
|
|
181
|
+
&:focus:not(:disabled) {
|
|
182
|
+
outline: none;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@mixin inputLabelPrimaryColorOnFocus($labelSelector) {
|
|
187
|
+
#{$labelSelector}.focus {
|
|
188
|
+
color: var(--color-primary);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
143
192
|
@mixin skeletonLoading() {
|
|
144
193
|
position: relative;
|
|
145
194
|
overflow: hidden;
|
|
@@ -160,7 +209,7 @@
|
|
|
160
209
|
rgba(#fff, 0)
|
|
161
210
|
);
|
|
162
211
|
animation: shimmer 2s infinite;
|
|
163
|
-
content:
|
|
212
|
+
content: "";
|
|
164
213
|
}
|
|
165
214
|
|
|
166
215
|
@keyframes shimmer {
|
package/src/types.d.ts
CHANGED
package/src/util/helper.test.tsx
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { generateID, filterProps } from
|
|
1
|
+
import { generateID, filterProps } from "./helper";
|
|
2
2
|
|
|
3
3
|
/* Generate an ID of 20 characters with a string woven in */
|
|
4
4
|
|
|
5
|
-
describe(
|
|
6
|
-
it(
|
|
7
|
-
const ID1 = generateID(20,
|
|
5
|
+
describe("generateID should correctly generate IDs in the correct way", () => {
|
|
6
|
+
it("generates an ID of length 20 with a string woven in", () => {
|
|
7
|
+
const ID1 = generateID(20, "thistestingstring");
|
|
8
8
|
expect(ID1.length).toBe(20);
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
it(
|
|
11
|
+
it("genereates an ID without a string woven in", () => {
|
|
12
12
|
const ID2 = generateID(20);
|
|
13
13
|
expect(ID2.length).toBe(20);
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
describe(
|
|
18
|
-
it(
|
|
17
|
+
describe("filterprops should return the correct object", () => {
|
|
18
|
+
it("gives back the props we told it to filter", () => {
|
|
19
19
|
const propsObject = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
title:
|
|
25
|
-
className:
|
|
20
|
+
"data-filter": true,
|
|
21
|
+
"data-test": false,
|
|
22
|
+
"aria-hidden": false,
|
|
23
|
+
"aria-expanded": true,
|
|
24
|
+
title: "test",
|
|
25
|
+
className: "example-classname"
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const returnedPropsObject = filterProps(propsObject, /^data-/);
|
|
29
29
|
|
|
30
|
-
expect(returnedPropsObject).toStrictEqual({
|
|
30
|
+
expect(returnedPropsObject).toStrictEqual({ "data-filter": true, "data-test": false });
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
it(
|
|
33
|
+
it("gives back the propsObject without the props we told it to filter", () => {
|
|
34
34
|
const propsObject = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
title:
|
|
40
|
-
className:
|
|
35
|
+
"data-filter": true,
|
|
36
|
+
"data-test": false,
|
|
37
|
+
"aria-hidden": false,
|
|
38
|
+
"aria-expanded": true,
|
|
39
|
+
title: "test",
|
|
40
|
+
className: "example-classname"
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const returnedPropsObject = filterProps(propsObject, /^data-/, false);
|
|
44
44
|
|
|
45
45
|
expect(returnedPropsObject).toStrictEqual({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
title:
|
|
49
|
-
className:
|
|
46
|
+
"aria-hidden": false,
|
|
47
|
+
"aria-expanded": true,
|
|
48
|
+
title: "test",
|
|
49
|
+
className: "example-classname"
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
});
|