@onewelcome/react-lib-components 0.2.1 → 0.2.4
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 +2 -2
- 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 +5 -5
- 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/interfaces.d.ts +1 -1
- package/dist/react-lib-components.cjs.development.js +683 -581
- 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 +683 -581
- 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 +97 -76
- package/src/ContextMenu/ContextMenu.tsx +48 -42
- package/src/ContextMenu/ContextMenuItem.module.scss +1 -1
- package/src/ContextMenu/ContextMenuItem.tsx +8 -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 +9 -9
- 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 +121 -73
- 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 +2 -2
- 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 +2 -2
- 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 +73 -72
- 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/interfaces.ts +1 -1
- 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
package/src/Tooltip/Tooltip.tsx
CHANGED
|
@@ -4,15 +4,15 @@ import React, {
|
|
|
4
4
|
useEffect,
|
|
5
5
|
useLayoutEffect,
|
|
6
6
|
useRef,
|
|
7
|
-
useState
|
|
8
|
-
} from
|
|
9
|
-
import { Icon, Icons } from
|
|
10
|
-
import classes from
|
|
11
|
-
import { generateID } from
|
|
12
|
-
import { Offset, Placement, usePosition } from
|
|
13
|
-
import { createPortal } from
|
|
7
|
+
useState
|
|
8
|
+
} from "react";
|
|
9
|
+
import { Icon, Icons } from "../Icon/Icon";
|
|
10
|
+
import classes from "./Tooltip.module.scss";
|
|
11
|
+
import { generateID } from "../util/helper";
|
|
12
|
+
import { Offset, Placement, usePosition } from "../hooks/usePosition";
|
|
13
|
+
import { createPortal } from "react-dom";
|
|
14
14
|
|
|
15
|
-
export interface Props extends ComponentPropsWithRef<
|
|
15
|
+
export interface Props extends ComponentPropsWithRef<"div"> {
|
|
16
16
|
label: string | ReactNode;
|
|
17
17
|
children: string;
|
|
18
18
|
placement?: Placement;
|
|
@@ -28,9 +28,9 @@ interface DefaultPosition {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const defaultPosition: DefaultPosition = {
|
|
31
|
-
placement: { horizontal:
|
|
31
|
+
placement: { horizontal: "right", vertical: "center" },
|
|
32
32
|
offset: { left: 16, right: 0, top: 0, bottom: 0 },
|
|
33
|
-
transformOrigin: { horizontal:
|
|
33
|
+
transformOrigin: { horizontal: "left", vertical: "center" }
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export const Tooltip = React.forwardRef<HTMLDivElement, Props>(
|
|
@@ -58,22 +58,22 @@ export const Tooltip = React.forwardRef<HTMLDivElement, Props>(
|
|
|
58
58
|
elementToBePositioned: elementToBePositioned,
|
|
59
59
|
placement: placement,
|
|
60
60
|
offset: offset,
|
|
61
|
-
transformOrigin: transformOrigin
|
|
61
|
+
transformOrigin: transformOrigin
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
useEffect(() => {
|
|
65
65
|
if (!visible) return;
|
|
66
66
|
|
|
67
67
|
function escapePressHandler(event: KeyboardEvent) {
|
|
68
|
-
if (event.key ===
|
|
68
|
+
if (event.key === "Escape") {
|
|
69
69
|
setVisible(false);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
document.addEventListener(
|
|
73
|
+
document.addEventListener("keyup", escapePressHandler);
|
|
74
74
|
|
|
75
75
|
return () => {
|
|
76
|
-
document.removeEventListener(
|
|
76
|
+
document.removeEventListener("keyup", escapePressHandler);
|
|
77
77
|
};
|
|
78
78
|
}, [visible]);
|
|
79
79
|
|
|
@@ -86,15 +86,15 @@ export const Tooltip = React.forwardRef<HTMLDivElement, Props>(
|
|
|
86
86
|
return React.cloneElement(label, {
|
|
87
87
|
onFocus: () => setVisible(true),
|
|
88
88
|
onBlur: () => setVisible(false),
|
|
89
|
-
|
|
89
|
+
"aria-describedby": identifier,
|
|
90
90
|
tabIndex: 0,
|
|
91
|
-
className: classes[
|
|
91
|
+
className: classes["label"]
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
return (
|
|
96
96
|
<span
|
|
97
|
-
className={classes[
|
|
97
|
+
className={classes["label"]}
|
|
98
98
|
tabIndex={0}
|
|
99
99
|
onFocus={() => setVisible(true)}
|
|
100
100
|
onBlur={() => setVisible(false)}
|
|
@@ -106,9 +106,9 @@ export const Tooltip = React.forwardRef<HTMLDivElement, Props>(
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
return (
|
|
109
|
-
<div {...rest} ref={ref} className={`${classes.wrapper} ${className ??
|
|
109
|
+
<div {...rest} ref={ref} className={`${classes.wrapper} ${className ?? ""}`}>
|
|
110
110
|
{renderChildren()}
|
|
111
|
-
<div className={`${classes[
|
|
111
|
+
<div className={`${classes["tooltip-wrapper"]}`}>
|
|
112
112
|
<Icon
|
|
113
113
|
ref={relativeElement}
|
|
114
114
|
tag="div"
|
|
@@ -125,11 +125,11 @@ export const Tooltip = React.forwardRef<HTMLDivElement, Props>(
|
|
|
125
125
|
top: top,
|
|
126
126
|
left: left,
|
|
127
127
|
right: right,
|
|
128
|
-
bottom: bottom
|
|
128
|
+
bottom: bottom
|
|
129
129
|
}}
|
|
130
130
|
aria-hidden={!visible}
|
|
131
131
|
id={identifier}
|
|
132
|
-
className={`${classes.tooltip} ${visible ? classes.visible :
|
|
132
|
+
className={`${classes.tooltip} ${visible ? classes.visible : ""}`}
|
|
133
133
|
>
|
|
134
134
|
{children}
|
|
135
135
|
</div>,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from
|
|
2
|
-
import { Typography, Props } from
|
|
3
|
-
import { render } from
|
|
4
|
-
import { Spacing } from
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import { Typography, Props } from "./Typography";
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
|
+
import { Spacing } from "../hooks/useSpacing";
|
|
5
5
|
|
|
6
6
|
const renderTypography = (
|
|
7
|
-
typoVariant: Props[
|
|
8
|
-
wrapper?: Props[
|
|
7
|
+
typoVariant: Props["variant"],
|
|
8
|
+
wrapper?: Props["tag"],
|
|
9
9
|
spacing?: Spacing
|
|
10
10
|
) => {
|
|
11
11
|
const queries = render(
|
|
@@ -14,109 +14,109 @@ const renderTypography = (
|
|
|
14
14
|
</Typography>
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
const typography = queries.getByTestId(
|
|
17
|
+
const typography = queries.getByTestId("component");
|
|
18
18
|
|
|
19
19
|
return {
|
|
20
20
|
...queries,
|
|
21
|
-
typography
|
|
21
|
+
typography
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
const className = (variant: Props[
|
|
25
|
+
const className = (variant: Props["variant"]) => `typography_style_${variant}`;
|
|
26
26
|
|
|
27
|
-
describe(
|
|
28
|
-
it(
|
|
29
|
-
const { typography } = renderTypography(
|
|
27
|
+
describe("Typography should render", () => {
|
|
28
|
+
it("renders without crashing", () => {
|
|
29
|
+
const { typography } = renderTypography("h1");
|
|
30
30
|
expect(typography).toBeDefined();
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
describe(
|
|
35
|
-
it(
|
|
36
|
-
const variant =
|
|
34
|
+
describe("Should give the correct default tags and corresponding classnames", () => {
|
|
35
|
+
it("renders an h1", () => {
|
|
36
|
+
const variant = "h1";
|
|
37
37
|
const { typography } = renderTypography(variant);
|
|
38
38
|
|
|
39
|
-
expect(typography.nodeName).toBe(
|
|
39
|
+
expect(typography.nodeName).toBe("H1");
|
|
40
40
|
expect(typography).toHaveClass(className(variant));
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
it(
|
|
44
|
-
const variant =
|
|
43
|
+
it("renders an h2", () => {
|
|
44
|
+
const variant = "h2";
|
|
45
45
|
const { typography } = renderTypography(variant);
|
|
46
46
|
|
|
47
|
-
expect(typography.nodeName).toBe(
|
|
47
|
+
expect(typography.nodeName).toBe("H2");
|
|
48
48
|
expect(typography).toHaveClass(className(variant));
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
it(
|
|
52
|
-
const variant =
|
|
51
|
+
it("renders an h3", () => {
|
|
52
|
+
const variant = "h3";
|
|
53
53
|
const { typography } = renderTypography(variant);
|
|
54
54
|
|
|
55
|
-
expect(typography.nodeName).toBe(
|
|
55
|
+
expect(typography.nodeName).toBe("H3");
|
|
56
56
|
expect(typography).toHaveClass(className(variant));
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
it(
|
|
60
|
-
const variant =
|
|
59
|
+
it("renders an h4", () => {
|
|
60
|
+
const variant = "h4";
|
|
61
61
|
const { typography } = renderTypography(variant);
|
|
62
62
|
|
|
63
|
-
expect(typography.nodeName).toBe(
|
|
63
|
+
expect(typography.nodeName).toBe("H4");
|
|
64
64
|
expect(typography).toHaveClass(className(variant));
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
it(
|
|
68
|
-
const variant =
|
|
67
|
+
it("renders a p", () => {
|
|
68
|
+
const variant = "body";
|
|
69
69
|
const { typography } = renderTypography(variant);
|
|
70
70
|
|
|
71
|
-
expect(typography.nodeName).toBe(
|
|
71
|
+
expect(typography.nodeName).toBe("P");
|
|
72
72
|
expect(typography).toHaveClass(className(variant));
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
it(
|
|
76
|
-
const variant =
|
|
75
|
+
it("renders a p", () => {
|
|
76
|
+
const variant = "body-bold";
|
|
77
77
|
const { typography } = renderTypography(variant);
|
|
78
78
|
|
|
79
|
-
expect(typography.nodeName).toBe(
|
|
79
|
+
expect(typography.nodeName).toBe("P");
|
|
80
80
|
expect(typography).toHaveClass(className(variant));
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
it(
|
|
84
|
-
const variant =
|
|
83
|
+
it("renders a span", () => {
|
|
84
|
+
const variant = "sub-text";
|
|
85
85
|
const { typography } = renderTypography(variant);
|
|
86
86
|
|
|
87
|
-
expect(typography.nodeName).toBe(
|
|
87
|
+
expect(typography.nodeName).toBe("SPAN");
|
|
88
88
|
expect(typography).toHaveClass(className(variant));
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
it(
|
|
92
|
-
const variant =
|
|
91
|
+
it("renders a code", () => {
|
|
92
|
+
const variant = "code";
|
|
93
93
|
const { typography } = renderTypography(variant);
|
|
94
94
|
|
|
95
|
-
expect(typography.nodeName).toBe(
|
|
95
|
+
expect(typography.nodeName).toBe("CODE");
|
|
96
96
|
expect(typography).toHaveClass(className(variant));
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
describe(
|
|
101
|
-
it(
|
|
102
|
-
const { typography } = renderTypography(
|
|
100
|
+
describe("Should override tagname", () => {
|
|
101
|
+
it("has to be a DIV element", () => {
|
|
102
|
+
const { typography } = renderTypography("h1", "div");
|
|
103
103
|
|
|
104
|
-
expect(typography.nodeName).toBe(
|
|
104
|
+
expect(typography.nodeName).toBe("DIV");
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
describe(
|
|
109
|
-
it(
|
|
110
|
-
const { typography } = renderTypography(
|
|
108
|
+
describe("Should override styling", () => {
|
|
109
|
+
it("renders h1 with overwritten margin properties", () => {
|
|
110
|
+
const { typography } = renderTypography("h1", undefined, { margin: 4, marginBottom: 8 });
|
|
111
111
|
|
|
112
|
-
expect(typography.style).toHaveProperty(
|
|
112
|
+
expect(typography.style).toHaveProperty("margin", "1rem 1rem 2rem 1rem");
|
|
113
113
|
});
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
describe(
|
|
117
|
-
it(
|
|
116
|
+
describe("ref should work", () => {
|
|
117
|
+
it("should give back the proper data prop, this also checks if the component propagates ...rest properly", () => {
|
|
118
118
|
const ExampleComponent = ({
|
|
119
|
-
propagateRef
|
|
119
|
+
propagateRef
|
|
120
120
|
}: {
|
|
121
121
|
propagateRef?: (ref: React.RefObject<HTMLElement>) => void;
|
|
122
122
|
}) => {
|
|
@@ -132,7 +132,7 @@ describe('ref should work', () => {
|
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
const refCheck = (ref: React.RefObject<HTMLElement>) => {
|
|
135
|
-
expect(ref.current).toHaveAttribute(
|
|
135
|
+
expect(ref.current).toHaveAttribute("data-ref", "testing");
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
render(<ExampleComponent propagateRef={refCheck} />);
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import React, { ComponentPropsWithRef, ReactNode } from
|
|
2
|
-
import classes from
|
|
3
|
-
import { Spacing, useSpacing } from
|
|
1
|
+
import React, { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import classes from "./Typography.module.scss";
|
|
3
|
+
import { Spacing, useSpacing } from "../hooks/useSpacing";
|
|
4
4
|
|
|
5
5
|
export const validVariants = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
"h1",
|
|
7
|
+
"h2",
|
|
8
|
+
"h3",
|
|
9
|
+
"h4",
|
|
10
|
+
"body",
|
|
11
|
+
"body-bold",
|
|
12
|
+
"sub-text",
|
|
13
|
+
"code"
|
|
14
14
|
] as const;
|
|
15
15
|
export type Variant = typeof validVariants[number];
|
|
16
16
|
|
|
17
17
|
type Tags =
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
18
|
+
| "h1"
|
|
19
|
+
| "h2"
|
|
20
|
+
| "h3"
|
|
21
|
+
| "h4"
|
|
22
|
+
| "p"
|
|
23
|
+
| "div"
|
|
24
|
+
| "code"
|
|
25
|
+
| "span"
|
|
26
|
+
| "sup"
|
|
27
|
+
| "sub"
|
|
28
|
+
| "strong"
|
|
29
|
+
| "em"
|
|
30
|
+
| "small"
|
|
31
|
+
| "mark"
|
|
32
|
+
| "del"
|
|
33
|
+
| "ins"
|
|
34
|
+
| "blockquote";
|
|
35
35
|
|
|
36
36
|
export interface Props extends ComponentPropsWithRef<any> {
|
|
37
37
|
children: ReactNode;
|
|
@@ -41,7 +41,7 @@ export interface Props extends ComponentPropsWithRef<any> {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export const Typography = React.forwardRef<any, Props>(
|
|
44
|
-
({ children, variant, tag, style, spacing, className =
|
|
44
|
+
({ children, variant, tag, style, spacing, className = "", ...rest }: Props, ref) => {
|
|
45
45
|
if (!validVariants.includes(variant)) {
|
|
46
46
|
throw new Error(
|
|
47
47
|
`You entered an invalid variant. You can choose from: ${validVariants}, you entered: ${variant}`
|
|
@@ -52,24 +52,24 @@ export const Typography = React.forwardRef<any, Props>(
|
|
|
52
52
|
|
|
53
53
|
if (!tag) {
|
|
54
54
|
switch (variant) {
|
|
55
|
-
case
|
|
56
|
-
case
|
|
57
|
-
case
|
|
58
|
-
case
|
|
59
|
-
case
|
|
55
|
+
case "h1":
|
|
56
|
+
case "h2":
|
|
57
|
+
case "h3":
|
|
58
|
+
case "h4":
|
|
59
|
+
case "code":
|
|
60
60
|
tag = variant;
|
|
61
61
|
break;
|
|
62
|
-
case
|
|
63
|
-
tag =
|
|
62
|
+
case "body":
|
|
63
|
+
tag = "p";
|
|
64
64
|
break;
|
|
65
|
-
case
|
|
66
|
-
tag =
|
|
65
|
+
case "body-bold":
|
|
66
|
+
tag = "p";
|
|
67
67
|
break;
|
|
68
|
-
case
|
|
69
|
-
tag =
|
|
68
|
+
case "sub-text":
|
|
69
|
+
tag = "span";
|
|
70
70
|
break;
|
|
71
71
|
default:
|
|
72
|
-
tag =
|
|
72
|
+
tag = "div";
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -81,7 +81,7 @@ export const Typography = React.forwardRef<any, Props>(
|
|
|
81
81
|
{...rest}
|
|
82
82
|
ref={ref}
|
|
83
83
|
style={styleWithSpacing}
|
|
84
|
-
className={`${classes[
|
|
84
|
+
className={`${classes["typography_style_" + variant]} ${className}`}
|
|
85
85
|
>
|
|
86
86
|
{children}
|
|
87
87
|
</TagName>
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { BaseWizardSteps, Props } from
|
|
3
|
-
import { getAllByRole, getByText, queryByText, render } from
|
|
4
|
-
import userEvent from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseWizardSteps, Props } from "./BaseWizardSteps";
|
|
3
|
+
import { getAllByRole, getByText, queryByText, render } from "@testing-library/react";
|
|
4
|
+
import userEvent from "@testing-library/user-event";
|
|
5
5
|
|
|
6
6
|
const initParams: Props = {
|
|
7
7
|
steps: [
|
|
8
8
|
{
|
|
9
|
-
label:
|
|
9
|
+
label: "Step 1"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
label:
|
|
12
|
+
label: "Step 2"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
label:
|
|
16
|
-
disabled: true
|
|
15
|
+
label: "Step 3",
|
|
16
|
+
disabled: true
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
label:
|
|
20
|
-
}
|
|
19
|
+
label: "Step 4"
|
|
20
|
+
}
|
|
21
21
|
],
|
|
22
22
|
currentStepNo: 1,
|
|
23
|
-
stepScreenReaderLabel:
|
|
24
|
-
onClick: jest.fn()
|
|
23
|
+
stepScreenReaderLabel: "Step",
|
|
24
|
+
onClick: jest.fn()
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const getStepButtons = (container: HTMLElement) => getAllByRole(container,
|
|
27
|
+
const getStepButtons = (container: HTMLElement) => getAllByRole(container, "button");
|
|
28
28
|
|
|
29
|
-
describe(
|
|
30
|
-
it(
|
|
29
|
+
describe("BaseWizardSteps", () => {
|
|
30
|
+
it("renders without crashing", () => {
|
|
31
31
|
const { container } = render(<BaseWizardSteps {...initParams} />);
|
|
32
32
|
const buttons = getStepButtons(container);
|
|
33
33
|
expect(initParams.onClick).toHaveBeenCalledTimes(0);
|
|
34
34
|
|
|
35
35
|
expect(buttons).toHaveLength(4);
|
|
36
|
-
expect(buttons[0]).not.toHaveAttribute(
|
|
37
|
-
expect(buttons[0].querySelector(
|
|
38
|
-
expect(buttons[1]).toHaveAttribute(
|
|
39
|
-
expect(getByText(buttons[1],
|
|
40
|
-
expect(buttons[2]).not.toHaveAttribute(
|
|
41
|
-
expect(getByText(buttons[2],
|
|
42
|
-
expect(buttons[3]).not.toHaveAttribute(
|
|
43
|
-
expect(getByText(buttons[3],
|
|
36
|
+
expect(buttons[0]).not.toHaveAttribute("aria-current");
|
|
37
|
+
expect(buttons[0].querySelector(".checkmark")).toBeDefined();
|
|
38
|
+
expect(buttons[1]).toHaveAttribute("aria-current", "step");
|
|
39
|
+
expect(getByText(buttons[1], "2")).toBeDefined();
|
|
40
|
+
expect(buttons[2]).not.toHaveAttribute("aria-current");
|
|
41
|
+
expect(getByText(buttons[2], "3")).toBeDefined();
|
|
42
|
+
expect(buttons[3]).not.toHaveAttribute("aria-current");
|
|
43
|
+
expect(getByText(buttons[3], "4")).toBeDefined();
|
|
44
44
|
|
|
45
45
|
userEvent.click(buttons[0]);
|
|
46
46
|
expect(initParams.onClick).toHaveBeenCalledTimes(1);
|
|
@@ -51,7 +51,7 @@ describe('BaseWizardSteps', () => {
|
|
|
51
51
|
expect(initParams.onClick).toHaveBeenCalledTimes(1);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
it(
|
|
54
|
+
it("should allow to click on future and prev steps but not on current and disabled steps when futureStepsClickable is enabled", () => {
|
|
55
55
|
const { container } = render(<BaseWizardSteps {...initParams} futureStepsClickable />);
|
|
56
56
|
const buttons = getStepButtons(container);
|
|
57
57
|
expect(initParams.onClick).toHaveBeenCalledTimes(0);
|
|
@@ -66,10 +66,10 @@ describe('BaseWizardSteps', () => {
|
|
|
66
66
|
expect(initParams.onClick).toHaveBeenCalledTimes(2);
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
it(
|
|
69
|
+
it("should not render checkmark or number when prev steps is disabled", () => {
|
|
70
70
|
const { container } = render(<BaseWizardSteps {...initParams} currentStepNo={3} />);
|
|
71
71
|
const buttons = getStepButtons(container);
|
|
72
72
|
|
|
73
|
-
expect(queryByText(buttons[2],
|
|
73
|
+
expect(queryByText(buttons[2], "3")).toBeNull();
|
|
74
74
|
});
|
|
75
75
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React, { ComponentPropsWithRef, Fragment } from
|
|
2
|
-
import classes from
|
|
3
|
-
import readyclasses from
|
|
4
|
-
import { Icon, Icons } from
|
|
1
|
+
import React, { ComponentPropsWithRef, Fragment } from "react";
|
|
2
|
+
import classes from "./BaseWizardSteps.module.scss";
|
|
3
|
+
import readyclasses from "../../readyclasses.module.scss";
|
|
4
|
+
import { Icon, Icons } from "../../Icon/Icon";
|
|
5
5
|
|
|
6
|
-
type StepState =
|
|
6
|
+
type StepState = "finished" | "current" | "future";
|
|
7
7
|
|
|
8
8
|
export interface Step {
|
|
9
9
|
label: string;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export interface Props extends Omit<ComponentPropsWithRef<
|
|
13
|
+
export interface Props extends Omit<ComponentPropsWithRef<"div">, "onClick"> {
|
|
14
14
|
steps: Step[];
|
|
15
15
|
currentStepNo: number;
|
|
16
16
|
onClick?: (stepNo: number) => void;
|
|
@@ -32,21 +32,21 @@ export const BaseWizardSteps = React.forwardRef<HTMLDivElement, Props>(
|
|
|
32
32
|
) => {
|
|
33
33
|
const getStepState = (stepNo: number): StepState => {
|
|
34
34
|
if (currentStepNo === stepNo) {
|
|
35
|
-
return
|
|
35
|
+
return "current";
|
|
36
36
|
} else if (stepNo < currentStepNo) {
|
|
37
|
-
return
|
|
37
|
+
return "finished";
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return "future";
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
const getStepContent = (stepState: StepState, index: number, disabled?: boolean) => {
|
|
43
43
|
const stepNumberString = String(index + 1);
|
|
44
|
-
if (stepState ===
|
|
45
|
-
return disabled ? null : <Icon className={classes[
|
|
44
|
+
if (stepState === "finished") {
|
|
45
|
+
return disabled ? null : <Icon className={classes["checkmark"]} icon={Icons.Checkmark} />;
|
|
46
46
|
} else {
|
|
47
47
|
return (
|
|
48
48
|
<Fragment>
|
|
49
|
-
<span className={readyclasses[
|
|
49
|
+
<span className={readyclasses["sr-only"]}>{stepScreenReaderLabel} </span>
|
|
50
50
|
{stepNumberString}
|
|
51
51
|
</Fragment>
|
|
52
52
|
);
|
|
@@ -55,35 +55,35 @@ export const BaseWizardSteps = React.forwardRef<HTMLDivElement, Props>(
|
|
|
55
55
|
|
|
56
56
|
const generatedSteps = steps.map((step, index) => {
|
|
57
57
|
const stepState = getStepState(index);
|
|
58
|
-
const disabledStyleClassName = step.disabled ? classes[
|
|
59
|
-
const clickableClassName = futureStepsClickable ? classes[
|
|
58
|
+
const disabledStyleClassName = step.disabled ? classes["disabled"] : "";
|
|
59
|
+
const clickableClassName = futureStepsClickable ? classes["clickable"] : "";
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
62
|
<button
|
|
63
|
-
key={step.label.toLowerCase().replace(/\s/,
|
|
63
|
+
key={step.label.toLowerCase().replace(/\s/, "-")}
|
|
64
64
|
disabled={
|
|
65
65
|
step.disabled ||
|
|
66
|
-
(stepState ===
|
|
67
|
-
stepState ===
|
|
66
|
+
(stepState === "future" && !futureStepsClickable) ||
|
|
67
|
+
stepState === "current"
|
|
68
68
|
}
|
|
69
|
-
aria-current={stepState ===
|
|
69
|
+
aria-current={stepState === "current" ? "step" : undefined}
|
|
70
70
|
onClick={() => onClick && onClick(index)}
|
|
71
|
-
className={`${classes[
|
|
71
|
+
className={`${classes["wizard-element"]} ${classes[stepState]} ${clickableClassName} ${disabledStyleClassName}`}
|
|
72
72
|
>
|
|
73
|
-
<div className={classes[
|
|
74
|
-
<span className={classes[
|
|
73
|
+
<div className={classes["number-wrapper"]}>
|
|
74
|
+
<span className={classes["number"]}>
|
|
75
75
|
{getStepContent(stepState, index, step.disabled)}
|
|
76
76
|
</span>
|
|
77
77
|
</div>
|
|
78
|
-
<div className={classes[
|
|
79
|
-
<span className={classes[
|
|
78
|
+
<div className={classes["two-line-text-overflow"]}>
|
|
79
|
+
<span className={classes["label"]}>{step.label}</span>
|
|
80
80
|
</div>
|
|
81
81
|
</button>
|
|
82
82
|
);
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
|
-
<div {...rest} ref={ref} className={classes[
|
|
86
|
+
<div {...rest} ref={ref} className={classes["wizard"]}>
|
|
87
87
|
{generatedSteps}
|
|
88
88
|
</div>
|
|
89
89
|
);
|