@onewelcome/react-lib-components 1.3.0 → 1.5.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.
Files changed (118) hide show
  1. package/README.md +7 -0
  2. package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  3. package/dist/Button/IconButton.d.ts +2 -1
  4. package/dist/ContextMenu/ContextMenu.d.ts +4 -1
  5. package/dist/DataGrid/DataGrid.d.ts +1 -0
  6. package/dist/DataGrid/DataGridActions/DataGridActions.d.ts +2 -1
  7. package/dist/DataGrid/DataGridActions/DataGridColumnsToggle.d.ts +1 -1
  8. package/dist/DataGrid/datagrid.interfaces.d.ts +4 -4
  9. package/dist/Form/Form.d.ts +3 -3
  10. package/dist/Form/FormControl/FormControl.d.ts +1 -1
  11. package/dist/Form/Input/Input.d.ts +1 -1
  12. package/dist/Form/Select/Select.d.ts +1 -1
  13. package/dist/Form/Select/Select.interfaces.d.ts +1 -1
  14. package/dist/Icon/Icon.d.ts +1 -1
  15. package/dist/Link/Link.d.ts +1 -1
  16. package/dist/Notifications/SlideInModal/SlideInModal.d.ts +1 -1
  17. package/dist/Notifications/Snackbar/interfaces.d.ts +2 -2
  18. package/dist/Pagination/Pagination.d.ts +3 -3
  19. package/dist/Popover/Popover.d.ts +3 -1
  20. package/dist/Tabs/Tab.d.ts +5 -9
  21. package/dist/Tabs/TabButton.d.ts +3 -6
  22. package/dist/Tabs/Tabs.d.ts +1 -2
  23. package/dist/Typography/Typography.d.ts +2 -2
  24. package/dist/Wizard/Wizard.d.ts +1 -1
  25. package/dist/Wizard/wizardStateReducer.d.ts +2 -2
  26. package/dist/_BaseStyling_/BaseStyling.d.ts +2 -0
  27. package/dist/hooks/usePosition.d.ts +6 -5
  28. package/dist/hooks/useSpacing.d.ts +3 -3
  29. package/dist/interfaces.d.ts +1 -1
  30. package/dist/react-lib-components.cjs.development.js +507 -440
  31. package/dist/react-lib-components.cjs.development.js.map +1 -1
  32. package/dist/react-lib-components.cjs.production.min.js +1 -1
  33. package/dist/react-lib-components.cjs.production.min.js.map +1 -1
  34. package/dist/react-lib-components.esm.js +508 -441
  35. package/dist/react-lib-components.esm.js.map +1 -1
  36. package/dist/util/helper.d.ts +1 -1
  37. package/package.json +36 -35
  38. package/src/Breadcrumbs/Breadcrumbs.tsx +46 -38
  39. package/src/Button/BaseButton.tsx +23 -20
  40. package/src/Button/Button.tsx +40 -40
  41. package/src/Button/IconButton.tsx +28 -28
  42. package/src/ContextMenu/ContextMenu.tsx +180 -168
  43. package/src/ContextMenu/ContextMenuItem.tsx +55 -49
  44. package/src/DataGrid/DataGrid.tsx +1 -0
  45. package/src/DataGrid/DataGridActions/DataGridActions.module.scss +1 -1
  46. package/src/DataGrid/DataGridActions/DataGridActions.test.tsx +4 -2
  47. package/src/DataGrid/DataGridActions/DataGridActions.tsx +95 -87
  48. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.tsx +64 -64
  49. package/src/DataGrid/DataGridBody/DataGridCell.tsx +42 -44
  50. package/src/DataGrid/DataGridBody/DataGridRow.tsx +29 -29
  51. package/src/DataGrid/DataGridHeader/DataGridHeader.tsx +78 -78
  52. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +48 -48
  53. package/src/Form/Checkbox/Checkbox.tsx +134 -130
  54. package/src/Form/Fieldset/Fieldset.tsx +81 -78
  55. package/src/Form/Form.tsx +9 -4
  56. package/src/Form/FormControl/FormControl.module.scss +1 -20
  57. package/src/Form/FormControl/FormControl.tsx +36 -35
  58. package/src/Form/FormGroup/FormGroup.tsx +62 -62
  59. package/src/Form/FormHelperText/FormHelperText.tsx +19 -18
  60. package/src/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +58 -53
  61. package/src/Form/Input/Input.test.tsx +12 -0
  62. package/src/Form/Input/Input.tsx +91 -87
  63. package/src/Form/Label/Label.tsx +17 -16
  64. package/src/Form/Radio/Radio.tsx +91 -91
  65. package/src/Form/Select/Option.tsx +66 -60
  66. package/src/Form/Select/Select.tsx +207 -209
  67. package/src/Form/Textarea/Textarea.tsx +51 -53
  68. package/src/Form/Toggle/Toggle.tsx +26 -23
  69. package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.tsx +51 -43
  70. package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +112 -106
  71. package/src/Form/Wrapper/RadioWrapper/RadioWrapper.tsx +67 -62
  72. package/src/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +42 -37
  73. package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +94 -94
  74. package/src/Form/Wrapper/Wrapper/Wrapper.tsx +73 -73
  75. package/src/Icon/Icon.tsx +19 -16
  76. package/src/Link/Link.tsx +68 -63
  77. package/src/Notifications/BaseModal/BaseModal.tsx +68 -68
  78. package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.tsx +13 -10
  79. package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.tsx +33 -25
  80. package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.tsx +20 -17
  81. package/src/Notifications/Dialog/Dialog.tsx +83 -83
  82. package/src/Notifications/Dialog/DialogActions/DialogActions.tsx +17 -14
  83. package/src/Notifications/Dialog/DialogTitle/DialogTitle.tsx +15 -12
  84. package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.tsx +40 -40
  85. package/src/Notifications/SlideInModal/SlideInModal.module.scss +5 -5
  86. package/src/Notifications/SlideInModal/SlideInModal.test.tsx +7 -2
  87. package/src/Notifications/SlideInModal/SlideInModal.tsx +47 -27
  88. package/src/Pagination/Pagination.tsx +169 -169
  89. package/src/Popover/Popover.module.scss +1 -0
  90. package/src/Popover/Popover.test.tsx +4 -1
  91. package/src/Popover/Popover.tsx +74 -32
  92. package/src/ProgressBar/ProgressBar.tsx +17 -14
  93. package/src/Skeleton/Skeleton.tsx +23 -20
  94. package/src/StatusIndicator/StatusIndicator.tsx +18 -15
  95. package/src/Tabs/{TabPanel.module.scss → Tab.module.scss} +1 -1
  96. package/src/Tabs/Tab.test.tsx +1 -39
  97. package/src/Tabs/Tab.tsx +16 -10
  98. package/src/Tabs/TabButton.module.scss +0 -4
  99. package/src/Tabs/TabButton.test.tsx +3 -31
  100. package/src/Tabs/TabButton.tsx +35 -49
  101. package/src/Tabs/Tabs.test.tsx +40 -33
  102. package/src/Tabs/Tabs.tsx +107 -101
  103. package/src/TextEllipsis/TextEllipsis.tsx +50 -41
  104. package/src/Tiles/Tile.tsx +58 -56
  105. package/src/Tiles/Tiles.tsx +44 -41
  106. package/src/Tooltip/Tooltip.test.tsx +5 -5
  107. package/src/Tooltip/Tooltip.tsx +101 -100
  108. package/src/Typography/Typography.tsx +47 -44
  109. package/src/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +55 -52
  110. package/src/Wizard/WizardSteps/WizardSteps.tsx +25 -22
  111. package/src/_BaseStyling_/BaseStyling.tsx +4 -0
  112. package/src/hooks/usePosition.test.tsx +85 -85
  113. package/src/hooks/usePosition.ts +6 -3
  114. package/src/mixins.module.scss +7 -7
  115. package/src/util/helper.test.tsx +0 -28
  116. package/dist/Tabs/TabPanel.d.ts +0 -8
  117. package/src/Tabs/TabPanel.test.tsx +0 -92
  118. package/src/Tabs/TabPanel.tsx +0 -43
@@ -16,6 +16,7 @@
16
16
 
17
17
  import React, {
18
18
  ComponentPropsWithRef,
19
+ ForwardRefRenderFunction,
19
20
  ReactElement,
20
21
  ReactNode,
21
22
  useEffect,
@@ -50,110 +51,110 @@ const defaultPosition: DefaultPosition = {
50
51
  transformOrigin: { horizontal: "left", vertical: "center" }
51
52
  };
52
53
 
53
- export const Tooltip = React.forwardRef<HTMLDivElement, Props>(
54
- (
55
- {
56
- children,
57
- className,
58
- placement = defaultPosition.placement,
59
- offset = defaultPosition.offset,
60
- transformOrigin = defaultPosition.transformOrigin,
61
- domRoot = document.body,
62
- label,
63
- ...rest
64
- }: Props,
65
- ref
66
- ) => {
67
- const [identifier] = useState(generateID());
68
- const [visible, setVisible] = useState(false);
69
-
70
- const relativeElement = useRef<HTMLDivElement>(null);
71
- const elementToBePositioned = useRef<HTMLDivElement>(null);
72
-
73
- const { top, bottom, right, left, calculatePosition } = usePosition({
74
- relativeElement: relativeElement,
75
- elementToBePositioned: elementToBePositioned,
76
- placement: placement,
77
- offset: offset,
78
- transformOrigin: transformOrigin
79
- });
80
-
81
- useEffect(() => {
82
- if (!visible) return;
83
-
84
- function escapePressHandler(event: KeyboardEvent) {
85
- if (event.key === "Escape") {
86
- setVisible(false);
87
- }
88
- }
54
+ const TooltipComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
55
+ {
56
+ children,
57
+ className,
58
+ placement = defaultPosition.placement,
59
+ offset = defaultPosition.offset,
60
+ transformOrigin = defaultPosition.transformOrigin,
61
+ domRoot = document.body,
62
+ label,
63
+ ...rest
64
+ }: Props,
65
+ ref
66
+ ) => {
67
+ const [identifier] = useState(generateID());
68
+ const [visible, setVisible] = useState(false);
69
+
70
+ const relativeElement = useRef<HTMLDivElement>(null);
71
+ const elementToBePositioned = useRef<HTMLDivElement>(null);
72
+
73
+ const { top, bottom, right, left, calculatePosition } = usePosition({
74
+ relativeElement: relativeElement,
75
+ elementToBePositioned: elementToBePositioned,
76
+ placement: placement,
77
+ offset: offset,
78
+ transformOrigin: transformOrigin
79
+ });
89
80
 
90
- document.addEventListener("keyup", escapePressHandler);
91
-
92
- return () => {
93
- document.removeEventListener("keyup", escapePressHandler);
94
- };
95
- }, [visible]);
96
-
97
- useLayoutEffect(() => {
98
- calculatePosition();
99
- }, [visible]);
100
-
101
- const renderChildren = () => {
102
- if (React.isValidElement(label)) {
103
- return React.cloneElement(label as ReactElement, {
104
- onFocus: () => setVisible(true),
105
- onBlur: () => setVisible(false),
106
- "aria-describedby": identifier,
107
- tabIndex: 0,
108
- className: classes["label"]
109
- });
81
+ useEffect(() => {
82
+ if (!visible) return;
83
+
84
+ function escapePressHandler(event: KeyboardEvent) {
85
+ if (event.key === "Escape") {
86
+ setVisible(false);
110
87
  }
88
+ }
89
+
90
+ document.addEventListener("keyup", escapePressHandler);
111
91
 
112
- return (
113
- <span
114
- className={classes["label"]}
115
- tabIndex={0}
116
- onFocus={() => setVisible(true)}
117
- onBlur={() => setVisible(false)}
118
- aria-describedby={identifier}
119
- >
120
- {label}
121
- </span>
122
- );
92
+ return () => {
93
+ document.removeEventListener("keyup", escapePressHandler);
123
94
  };
95
+ }, [visible]);
96
+
97
+ useLayoutEffect(() => {
98
+ calculatePosition();
99
+ }, [visible]);
100
+
101
+ const renderChildren = () => {
102
+ if (React.isValidElement(label)) {
103
+ return React.cloneElement(label as ReactElement, {
104
+ onFocus: () => setVisible(true),
105
+ onBlur: () => setVisible(false),
106
+ "aria-describedby": identifier,
107
+ tabIndex: 0,
108
+ className: classes["label"]
109
+ });
110
+ }
124
111
 
125
112
  return (
126
- <div {...rest} ref={ref} className={`${classes.wrapper} ${className ?? ""}`}>
127
- {renderChildren()}
128
- <div className={`${classes["tooltip-wrapper"]}`}>
129
- <Icon
130
- ref={relativeElement}
131
- tag="div"
132
- onMouseEnter={() => setVisible(true)}
133
- onMouseLeave={() => setVisible(false)}
134
- icon={Icons.InfoCircle}
135
- className={classes.icon}
136
- />
137
- {createPortal(
138
- <div
139
- ref={elementToBePositioned}
140
- style={{
141
- ...rest.style,
142
- top: top,
143
- left: left,
144
- right: right,
145
- bottom: bottom
146
- }}
147
- aria-hidden={!visible}
148
- id={identifier}
149
- className={`${classes.tooltip} ${visible ? classes.visible : ""}`}
150
- >
151
- {children}
152
- </div>,
153
- domRoot
154
- )}
155
- </div>
156
- </div>
113
+ <span
114
+ className={classes["label"]}
115
+ tabIndex={0}
116
+ onFocus={() => setVisible(true)}
117
+ onBlur={() => setVisible(false)}
118
+ aria-describedby={identifier}
119
+ >
120
+ {label}
121
+ </span>
157
122
  );
158
- }
159
- );
123
+ };
124
+
125
+ return (
126
+ <div {...rest} ref={ref} className={`${classes.wrapper} ${className ?? ""}`}>
127
+ {renderChildren()}
128
+ <div className={`${classes["tooltip-wrapper"]}`}>
129
+ <Icon
130
+ ref={relativeElement}
131
+ tag="div"
132
+ onMouseEnter={() => setVisible(true)}
133
+ onMouseLeave={() => setVisible(false)}
134
+ icon={Icons.InfoCircle}
135
+ className={classes.icon}
136
+ />
137
+ {createPortal(
138
+ <div
139
+ ref={elementToBePositioned}
140
+ style={{
141
+ ...rest.style,
142
+ top: top,
143
+ left: left,
144
+ right: right,
145
+ bottom: bottom
146
+ }}
147
+ aria-hidden={!visible}
148
+ id={identifier}
149
+ className={`${classes.tooltip} ${visible ? classes.visible : ""}`}
150
+ >
151
+ {children}
152
+ </div>,
153
+ domRoot
154
+ )}
155
+ </div>
156
+ </div>
157
+ );
158
+ };
159
+
160
+ export const Tooltip = React.forwardRef(TooltipComponent);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React, { ComponentPropsWithRef, ReactNode } from "react";
17
+ import React, { ForwardRefRenderFunction, ComponentPropsWithRef, ReactNode } from "react";
18
18
  import classes from "./Typography.module.scss";
19
19
  import { Spacing, useSpacing } from "../hooks/useSpacing";
20
20
 
@@ -56,51 +56,54 @@ export interface Props extends ComponentPropsWithRef<any> {
56
56
  spacing?: Spacing;
57
57
  }
58
58
 
59
- export const Typography = React.forwardRef<any, Props>(
60
- ({ children, variant, tag, style, spacing, className = "", ...rest }: Props, ref) => {
61
- if (!validVariants.includes(variant)) {
62
- throw new Error(
63
- `You entered an invalid variant. You can choose from: ${validVariants}, you entered: ${variant}`
64
- );
65
- }
59
+ const TypographyComponent: ForwardRefRenderFunction<any, Props> = (
60
+ { children, variant, tag, style, spacing, className = "", ...rest }: Props,
61
+ ref
62
+ ) => {
63
+ if (!validVariants.includes(variant)) {
64
+ throw new Error(
65
+ `You entered an invalid variant. You can choose from: ${validVariants}, you entered: ${variant}`
66
+ );
67
+ }
66
68
 
67
- const styleWithSpacing = useSpacing(spacing, style);
69
+ const styleWithSpacing = useSpacing(spacing, style);
68
70
 
69
- if (!tag) {
70
- switch (variant) {
71
- case "h1":
72
- case "h2":
73
- case "h3":
74
- case "h4":
75
- case "code":
76
- tag = variant;
77
- break;
78
- case "body":
79
- tag = "p";
80
- break;
81
- case "body-bold":
82
- tag = "p";
83
- break;
84
- case "sub-text":
85
- tag = "span";
86
- break;
87
- default:
88
- tag = "div";
89
- break;
90
- }
71
+ if (!tag) {
72
+ switch (variant) {
73
+ case "h1":
74
+ case "h2":
75
+ case "h3":
76
+ case "h4":
77
+ case "code":
78
+ tag = variant;
79
+ break;
80
+ case "body":
81
+ tag = "p";
82
+ break;
83
+ case "body-bold":
84
+ tag = "p";
85
+ break;
86
+ case "sub-text":
87
+ tag = "span";
88
+ break;
89
+ default:
90
+ tag = "div";
91
+ break;
91
92
  }
93
+ }
92
94
 
93
- let TagName = tag;
95
+ let TagName = tag;
94
96
 
95
- return (
96
- <TagName
97
- {...rest}
98
- ref={ref}
99
- style={styleWithSpacing}
100
- className={`${classes["typography_style_" + variant]} ${className}`}
101
- >
102
- {children}
103
- </TagName>
104
- );
105
- }
106
- );
97
+ return (
98
+ <TagName
99
+ {...rest}
100
+ ref={ref}
101
+ style={styleWithSpacing}
102
+ className={`${classes["typography_style_" + variant]} ${className}`}
103
+ >
104
+ {children}
105
+ </TagName>
106
+ );
107
+ };
108
+
109
+ export const Typography = React.forwardRef(TypographyComponent);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React, { ComponentPropsWithRef, Fragment } from "react";
17
+ import React, { ForwardRefRenderFunction, ComponentPropsWithRef, Fragment } from "react";
18
18
  import classes from "./BaseWizardSteps.module.scss";
19
19
  import { Icon, Icons } from "../../Icon/Icon";
20
20
 
@@ -32,59 +32,62 @@ export interface Props extends Omit<ComponentPropsWithRef<"div">, "onClick"> {
32
32
  futureStepsClickable?: boolean;
33
33
  }
34
34
 
35
- export const BaseWizardSteps = React.forwardRef<HTMLDivElement, Props>(
36
- ({ steps, currentStepNo, onClick, futureStepsClickable = false, ...rest }: Props, ref) => {
37
- const getStepState = (stepNo: number): StepState => {
38
- if (currentStepNo === stepNo) {
39
- return "current";
40
- } else if (stepNo < currentStepNo) {
41
- return "finished";
42
- }
43
- return "future";
44
- };
35
+ const BaseWizardStepsComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
36
+ { steps, currentStepNo, onClick, futureStepsClickable = false, ...rest }: Props,
37
+ ref
38
+ ) => {
39
+ const getStepState = (stepNo: number): StepState => {
40
+ if (currentStepNo === stepNo) {
41
+ return "current";
42
+ } else if (stepNo < currentStepNo) {
43
+ return "finished";
44
+ }
45
+ return "future";
46
+ };
45
47
 
46
- const getStepContent = (stepState: StepState, index: number, disabled?: boolean) => {
47
- const stepNumberString = String(index + 1);
48
- if (stepState === "finished") {
49
- return disabled ? null : <Icon className={classes["checkmark"]} icon={Icons.Checkmark} />;
50
- } else {
51
- return <Fragment>{stepNumberString}</Fragment>;
52
- }
53
- };
48
+ const getStepContent = (stepState: StepState, index: number, disabled?: boolean) => {
49
+ const stepNumberString = String(index + 1);
50
+ if (stepState === "finished") {
51
+ return disabled ? null : <Icon className={classes["checkmark"]} icon={Icons.Checkmark} />;
52
+ } else {
53
+ return <Fragment>{stepNumberString}</Fragment>;
54
+ }
55
+ };
54
56
 
55
- const generatedSteps = steps.map((step, index) => {
56
- const stepState = getStepState(index);
57
- const disabledStyleClassName = step.disabled ? classes["disabled"] : "";
58
- const clickableClassName = futureStepsClickable ? classes["clickable"] : "";
59
-
60
- return (
61
- <button
62
- key={step.label.toLowerCase().replace(/\s/, "-")}
63
- disabled={
64
- step.disabled ||
65
- (stepState === "future" && !futureStepsClickable) ||
66
- stepState === "current"
67
- }
68
- aria-current={stepState === "current" ? "step" : undefined}
69
- onClick={() => onClick && onClick(index)}
70
- className={`${classes["wizard-element"]} ${classes[stepState]} ${clickableClassName} ${disabledStyleClassName}`}
71
- >
72
- <div className={classes["number-wrapper"]}>
73
- <span className={classes["number"]}>
74
- {getStepContent(stepState, index, step.disabled)}
75
- </span>
76
- </div>
77
- <div className={classes["two-line-text-overflow"]}>
78
- <span className={classes["label"]}>{step.label}</span>
79
- </div>
80
- </button>
81
- );
82
- });
57
+ const generatedSteps = steps.map((step, index) => {
58
+ const stepState = getStepState(index);
59
+ const disabledStyleClassName = step.disabled ? classes["disabled"] : "";
60
+ const clickableClassName = futureStepsClickable ? classes["clickable"] : "";
83
61
 
84
62
  return (
85
- <div {...rest} ref={ref} className={classes["wizard"]}>
86
- {generatedSteps}
87
- </div>
63
+ <button
64
+ key={step.label.toLowerCase().replace(/\s/, "-")}
65
+ disabled={
66
+ step.disabled ||
67
+ (stepState === "future" && !futureStepsClickable) ||
68
+ stepState === "current"
69
+ }
70
+ aria-current={stepState === "current" ? "step" : undefined}
71
+ onClick={() => onClick && onClick(index)}
72
+ className={`${classes["wizard-element"]} ${classes[stepState]} ${clickableClassName} ${disabledStyleClassName}`}
73
+ >
74
+ <div className={classes["number-wrapper"]}>
75
+ <span className={classes["number"]}>
76
+ {getStepContent(stepState, index, step.disabled)}
77
+ </span>
78
+ </div>
79
+ <div className={classes["two-line-text-overflow"]}>
80
+ <span className={classes["label"]}>{step.label}</span>
81
+ </div>
82
+ </button>
88
83
  );
89
- }
90
- );
84
+ });
85
+
86
+ return (
87
+ <div {...rest} ref={ref} className={classes["wizard"]}>
88
+ {generatedSteps}
89
+ </div>
90
+ );
91
+ };
92
+
93
+ export const BaseWizardSteps = React.forwardRef(BaseWizardStepsComponent);
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React, { ComponentPropsWithRef, useContext } from "react";
17
+ import React, { ForwardRefRenderFunction, ComponentPropsWithRef, useContext } from "react";
18
18
  import { WizardStateContext } from "../WizardStateProvider";
19
19
  import { BaseWizardSteps } from "../BaseWizardSteps/BaseWizardSteps";
20
20
  import { changeCurrentStepNo } from "../wizardStateReducer";
@@ -23,26 +23,29 @@ export interface Props extends ComponentPropsWithRef<"div"> {
23
23
  onStepClick: (currentStepNo: number, selectedStepNo: number) => boolean;
24
24
  }
25
25
 
26
- export const WizardSteps = React.forwardRef<HTMLDivElement, Props>(
27
- ({ onStepClick, ...rest }: Props, ref) => {
28
- const {
29
- state: { currentStepNo, mode, steps },
30
- dispatch
31
- } = useContext(WizardStateContext);
26
+ const WizardStepsComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
27
+ { onStepClick, ...rest }: Props,
28
+ ref
29
+ ) => {
30
+ const {
31
+ state: { currentStepNo, mode, steps },
32
+ dispatch
33
+ } = useContext(WizardStateContext);
32
34
 
33
- const onClick = (selectedStepNo: number) => {
34
- onStepClick(currentStepNo, selectedStepNo) && dispatch(changeCurrentStepNo(selectedStepNo));
35
- };
35
+ const onClick = (selectedStepNo: number) => {
36
+ onStepClick(currentStepNo, selectedStepNo) && dispatch(changeCurrentStepNo(selectedStepNo));
37
+ };
36
38
 
37
- return (
38
- <BaseWizardSteps
39
- {...rest}
40
- ref={ref}
41
- onClick={onClick}
42
- steps={steps}
43
- currentStepNo={currentStepNo}
44
- futureStepsClickable={mode === "edit"}
45
- />
46
- );
47
- }
48
- );
39
+ return (
40
+ <BaseWizardSteps
41
+ {...rest}
42
+ ref={ref}
43
+ onClick={onClick}
44
+ steps={steps}
45
+ currentStepNo={currentStepNo}
46
+ futureStepsClickable={mode === "edit"}
47
+ />
48
+ );
49
+ };
50
+
51
+ export const WizardSteps = React.forwardRef(WizardStepsComponent);
@@ -42,6 +42,8 @@ interface CSSProperties {
42
42
  modalShadowColor?: string;
43
43
  modalBackgroundColor?: string;
44
44
  modalHeaderBackgroundColor?: string;
45
+ skeletonBackgroundColor?: string;
46
+ skeletonAnimationColorRgb?: string;
45
47
  snackbarTextColor?: string;
46
48
  snackbarInfoBackgroundColor?: string;
47
49
  snackbarSuccessBackgroundColor?: string;
@@ -103,6 +105,8 @@ export const BaseStyling = ({ children, properties = {} }: Props) => {
103
105
  modalShadowColor: "rgba(0, 0, 0, 0.16)",
104
106
  modalBackgroundColor: "#f5f8f8",
105
107
  modalHeaderBackgroundColor: "var(--light)",
108
+ skeletonBackgroundColor: "var(--disabled)",
109
+ skeletonAnimationColorRgb: "255, 255, 255",
106
110
  snackbarTextColor: "var(--light)",
107
111
  snackbarInfoBackgroundColor: "#003b5e",
108
112
  snackbarSuccessBackgroundColor: "#008a28",